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

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

parent 77f2d91b
......@@ -1540,7 +1540,8 @@
// Режим перемещения диапазона
if (t.isMoveRangeMode) {
event.currentTarget.style.cursor = ctrlKey ? "copy" : "move";
if (event.currentTarget && event.currentTarget.style)
event.currentTarget.style.cursor = ctrlKey ? "copy" : "move";
t._moveRangeHandle(event);
return true;
}
......
......@@ -5933,11 +5933,11 @@
};
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;
};
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 col = -1, row = -1;
......@@ -6119,13 +6119,14 @@
offsetY = (y < this.cellsTop + heightDiff) ? 0 : offsetY - heightDiff;
}
var epsChangeSize = 3 * AscCommon.global_mouseEvent.KoefPixToMM;
if (x <= this.cellsLeft && y >= this.cellsTop) {
r = this._findRowUnderCursor(y, true);
if (r === null) {
return oResDefault;
}
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)
return {
cursor: f ? kCurRowResize : kCurRowSelect,
......@@ -6141,7 +6142,7 @@
return oResDefault;
}
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)
return {
cursor: f ? kCurColResize : kCurColSelect,
......
......@@ -622,6 +622,9 @@ function (window, undefined)
var _x2 = this.RectSelect2.x + this.RectSelect2.w - 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)
{
global_mouseEvent.Button = 0;
......@@ -667,7 +670,7 @@ function (window, undefined)
case AscCommon.MobileTouchMode.FlowObj:
case AscCommon.MobileTouchMode.SelectTrack:
{
if (bIsKoefPixToMM)
if (bIsKoefPixToMM || this.Mode == AscCommon.MobileTouchMode.SelectTrack)
{
global_mouseEvent.KoefPixToMM = 5;
}
......@@ -874,10 +877,6 @@ function (window, undefined)
{
// TODO:
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;
break;
}
......@@ -897,6 +896,9 @@ function (window, undefined)
this.checkPointerMultiTouchRemove(e);
// нужен лив, чтобы сбросить состояния
this.delegate.Api.controller._onMouseLeave(e.changedTouches ? e.changedTouches[0] : e);
if (this.Api.isViewMode || isPreventDefault)
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