Commit 5038be8a authored by Oleg Korshul's avatar Oleg Korshul

mobile web excel: new tracks (developing...)

parent 77f2d91b
...@@ -1540,6 +1540,7 @@ ...@@ -1540,6 +1540,7 @@
// Режим перемещения диапазона // Режим перемещения диапазона
if (t.isMoveRangeMode) { if (t.isMoveRangeMode) {
if (event.currentTarget && event.currentTarget.style)
event.currentTarget.style.cursor = ctrlKey ? "copy" : "move"; event.currentTarget.style.cursor = ctrlKey ? "copy" : "move";
t._moveRangeHandle(event); t._moveRangeHandle(event);
return true; return true;
......
...@@ -5933,11 +5933,11 @@ ...@@ -5933,11 +5933,11 @@
}; };
WorksheetView.prototype._hitResizeCorner = function (x1, y1, x2, y2) { WorksheetView.prototype._hitResizeCorner = function (x1, y1, x2, y2) {
var wEps = this.width_1px, hEps = this.height_1px; var wEps = this.width_1px * AscCommon.global_mouseEvent.KoefPixToMM, hEps = this.height_1px * AscCommon.global_mouseEvent.KoefPixToMM;
return Math.abs(x2 - x1) <= wEps + this.width_2px && Math.abs(y2 - y1) <= hEps + this.height_2px; return Math.abs(x2 - x1) <= wEps + this.width_2px && Math.abs(y2 - y1) <= hEps + this.height_2px;
}; };
WorksheetView.prototype._hitInRange = function (range, rangeType, vr, x, y, offsetX, offsetY) { WorksheetView.prototype._hitInRange = function (range, rangeType, vr, x, y, offsetX, offsetY) {
var wEps = this.width_2px, hEps = this.height_2px; var wEps = this.width_2px * AscCommon.global_mouseEvent.KoefPixToMM, hEps = this.height_2px * AscCommon.global_mouseEvent.KoefPixToMM;
var cursor, x1, x2, y1, y2, isResize; var cursor, x1, x2, y1, y2, isResize;
var col = -1, row = -1; var col = -1, row = -1;
...@@ -6119,13 +6119,14 @@ ...@@ -6119,13 +6119,14 @@
offsetY = (y < this.cellsTop + heightDiff) ? 0 : offsetY - heightDiff; offsetY = (y < this.cellsTop + heightDiff) ? 0 : offsetY - heightDiff;
} }
var epsChangeSize = 3 * AscCommon.global_mouseEvent.KoefPixToMM;
if (x <= this.cellsLeft && y >= this.cellsTop) { if (x <= this.cellsLeft && y >= this.cellsTop) {
r = this._findRowUnderCursor(y, true); r = this._findRowUnderCursor(y, true);
if (r === null) { if (r === null) {
return oResDefault; return oResDefault;
} }
isNotFirst = (r.row !== (-1 !== rFrozen ? 0 : this.visibleRange.r1)); isNotFirst = (r.row !== (-1 !== rFrozen ? 0 : this.visibleRange.r1));
f = !isViewerMode && (isNotFirst && y < r.top + 3 || y >= r.bottom - 3); f = !isViewerMode && (isNotFirst && y < r.top + epsChangeSize || y >= r.bottom - epsChangeSize);
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3) // ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return { return {
cursor: f ? kCurRowResize : kCurRowSelect, cursor: f ? kCurRowResize : kCurRowSelect,
...@@ -6141,7 +6142,7 @@ ...@@ -6141,7 +6142,7 @@
return oResDefault; return oResDefault;
} }
isNotFirst = c.col !== (-1 !== cFrozen ? 0 : this.visibleRange.c1); isNotFirst = c.col !== (-1 !== cFrozen ? 0 : this.visibleRange.c1);
f = !isViewerMode && (isNotFirst && x < c.left + 3 || x >= c.right - 3); f = !isViewerMode && (isNotFirst && x < c.left + epsChangeSize || x >= c.right - epsChangeSize);
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3) // ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return { return {
cursor: f ? kCurColResize : kCurColSelect, cursor: f ? kCurColResize : kCurColSelect,
......
...@@ -622,6 +622,9 @@ function (window, undefined) ...@@ -622,6 +622,9 @@ function (window, undefined)
var _x2 = this.RectSelect2.x + this.RectSelect2.w - 0.5; var _x2 = this.RectSelect2.x + this.RectSelect2.w - 0.5;
var _y2 = this.RectSelect2.y + this.RectSelect2.h - 0.5; var _y2 = this.RectSelect2.y + this.RectSelect2.h - 0.5;
if (this.RectSelectType == Asc.c_oAscSelectionType.RangeCol || this.RectSelectType == Asc.c_oAscSelectionType.RangeRow)
AscCommon.global_mouseEvent.KoefPixToMM = -10; // чтобы не попасть в движения
if (1 == this.DragSelect) if (1 == this.DragSelect)
{ {
global_mouseEvent.Button = 0; global_mouseEvent.Button = 0;
...@@ -667,7 +670,7 @@ function (window, undefined) ...@@ -667,7 +670,7 @@ function (window, undefined)
case AscCommon.MobileTouchMode.FlowObj: case AscCommon.MobileTouchMode.FlowObj:
case AscCommon.MobileTouchMode.SelectTrack: case AscCommon.MobileTouchMode.SelectTrack:
{ {
if (bIsKoefPixToMM) if (bIsKoefPixToMM || this.Mode == AscCommon.MobileTouchMode.SelectTrack)
{ {
global_mouseEvent.KoefPixToMM = 5; global_mouseEvent.KoefPixToMM = 5;
} }
...@@ -874,10 +877,6 @@ function (window, undefined) ...@@ -874,10 +877,6 @@ function (window, undefined)
{ {
// TODO: // TODO:
this.delegate.Drawing_OnMouseUp(e.changedTouches ? e.changedTouches[0] : e); this.delegate.Drawing_OnMouseUp(e.changedTouches ? e.changedTouches[0] : e);
if (AscCommon.MobileTouchMode.SelectTrack == this.Mode)
this.delegate.Api.controller._onMouseLeave(e.changedTouches ? e.changedTouches[0] : e);
this.Mode = AscCommon.MobileTouchMode.None; this.Mode = AscCommon.MobileTouchMode.None;
break; break;
} }
...@@ -897,6 +896,9 @@ function (window, undefined) ...@@ -897,6 +896,9 @@ function (window, undefined)
this.checkPointerMultiTouchRemove(e); this.checkPointerMultiTouchRemove(e);
// нужен лив, чтобы сбросить состояния
this.delegate.Api.controller._onMouseLeave(e.changedTouches ? e.changedTouches[0] : e);
if (this.Api.isViewMode || isPreventDefault) if (this.Api.isViewMode || isPreventDefault)
AscCommon.g_inputContext.preventVirtualKeyboard(e); AscCommon.g_inputContext.preventVirtualKeyboard(e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment