Commit 8ffdab5f authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

c_oAscMouseMoveType add ResizeColumn and ResizeRow

add c_oTargetType для определения типа объекта "наведения"

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56021 954022d7-b5bf-4e40-9824-e11837661b57
parent 7432b07d
...@@ -228,7 +228,9 @@ var c_oAscMouseMoveType = { ...@@ -228,7 +228,9 @@ var c_oAscMouseMoveType = {
None : 0, None : 0,
Hyperlink : 1, Hyperlink : 1,
Comment : 2, Comment : 2,
LockedObject : 3 LockedObject : 3,
ResizeColumn : 4,
ResizeRow : 5
}; };
var c_oAscMouseMoveLockedObjectType = { var c_oAscMouseMoveLockedObjectType = {
...@@ -469,6 +471,22 @@ var c_oAscFindLookIn = { ...@@ -469,6 +471,22 @@ var c_oAscFindLookIn = {
Value : 2, Value : 2,
Annotations : 3 Annotations : 3
}; };
var c_oTargetType = {
None : 0,
ColumnResize : 1,
RowResize : 2,
FillHandle : 3,
MoveRange : 4,
MoveResizeRange : 5,
FilterObject : 6,
ColumnHeader : 7,
RowHeader : 8,
Corner : 9,
Hyperlink : 10,
Cells : 11,
Shape : 12
};
var c_oAscCoAuthoringMeBorderColor = new window.CColor(22, 156, 0); var c_oAscCoAuthoringMeBorderColor = new window.CColor(22, 156, 0);
var c_oAscCoAuthoringOtherBorderColor = new window.CColor(238, 53, 37); var c_oAscCoAuthoringOtherBorderColor = new window.CColor(238, 53, 37);
......
...@@ -1228,7 +1228,7 @@ var gUndoInsDelCellsFlag = true; ...@@ -1228,7 +1228,7 @@ var gUndoInsDelCellsFlag = true;
var y1 = button.y; var y1 = button.y;
var y2 = button.y + height; var y2 = button.y + height;
if (x >= x1 && x <= x2 && y >= y1 && y <= y2 && y1 >= offset.top && x1 >= offset.left) { if (x >= x1 && x <= x2 && y >= y1 && y <= y2 && y1 >= offset.top && x1 >= offset.left) {
return {id: i, target: "aFilterObject", col: -1, row: -1}; return {id: i, target: c_oTargetType.FilterObject, col: -1, row: -1};
} }
} }
return false; return false;
......
...@@ -287,9 +287,10 @@ ...@@ -287,9 +287,10 @@
// Для формулы не нужно выходить из редактирования ячейки // Для формулы не нужно выходить из редактирования ячейки
if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectionDialogMode) {return true;} if (t.settings.isViewerMode || t.isFormulaEditMode || t.isSelectionDialogMode) {return true;}
if( this.targetInfo && ( this.targetInfo.target == "moveResizeRange" || this.targetInfo.target == "moveRange" || this.targetInfo.target == "fillhandle" ) ){ if(this.targetInfo && (this.targetInfo.target == c_oTargetType.MoveResizeRange ||
this.targetInfo.target == c_oTargetType.MoveRange ||
this.targetInfo.target == c_oTargetType.FillHandle))
return true; return true;
}
if (t.isCellEditMode) {if (!t.handlers.trigger("stopCellEditing")) {return true;}} if (t.isCellEditMode) {if (!t.handlers.trigger("stopCellEditing")) {return true;}}
...@@ -1278,35 +1279,31 @@ ...@@ -1278,35 +1279,31 @@
return; return;
} }
if (t.targetInfo){ if (t.targetInfo){
if (t.targetInfo.target === "colresize" || t.targetInfo.target === "rowresize") { if (t.targetInfo.target === c_oTargetType.ColumnResize || t.targetInfo.target === c_oTargetType.RowResize) {
t.isResizeMode = true; t.isResizeMode = true;
t._resizeElement(event); t._resizeElement(event);
return; return;
} else if (t.targetInfo && t.targetInfo.target === "fillhandle" && false === this.settings.isViewerMode){ } else if (t.targetInfo && t.targetInfo.target === c_oTargetType.FillHandle && false === this.settings.isViewerMode) {
// В режиме автозаполнения // В режиме автозаполнения
this.isFillHandleMode = true; this.isFillHandleMode = true;
t._changeFillHandle(event); t._changeFillHandle(event);
return; return;
} else if ( t.targetInfo && t.targetInfo.target === "moveRange" && false === this.settings.isViewerMode ) { } else if (t.targetInfo && t.targetInfo.target === c_oTargetType.MoveRange && false === this.settings.isViewerMode) {
// В режиме перемещения диапазона // В режиме перемещения диапазона
this.isMoveRangeMode = true; this.isMoveRangeMode = true;
t._moveRangeHandle(event); t._moveRangeHandle(event);
return; return;
} } else if (t.targetInfo && t.targetInfo.target === c_oTargetType.FilterObject) {
else if (t.targetInfo && (t.targetInfo.target === "aFilterObject")) {
t._autoFiltersClick(t.targetInfo.idFilter); t._autoFiltersClick(t.targetInfo.idFilter);
return; return;
} } else if (t.targetInfo && (undefined !== t.targetInfo.commentIndexes) && (false === this.settings.isViewerMode)) {
else if (t.targetInfo && (undefined !== t.targetInfo.commentIndexes) && (false === this.settings.isViewerMode)) {
t._commentCellClick(event); t._commentCellClick(event);
} } else if ( t.targetInfo && t.targetInfo.target === c_oTargetType.MoveResizeRange && false === this.settings.isViewerMode ){
else if ( t.targetInfo && t.targetInfo.target === "moveResizeRange" && false === this.settings.isViewerMode ){
this.isMoveResizeRange = true; this.isMoveResizeRange = true;
this.isMoveResizeChartsRange = true; this.isMoveResizeChartsRange = true;
t._moveResizeRangeHandle(event, t.targetInfo); t._moveResizeRangeHandle(event, t.targetInfo);
return; return;
} } else if ( t.targetInfo && ((t.targetInfo.target === "frozenAnchorV") || (t.targetInfo.target === "frozenAnchorH")) ) {
else if ( t.targetInfo && ((t.targetInfo.target === "frozenAnchorV") || (t.targetInfo.target === "frozenAnchorH")) ) {
// Режим установки закреплённых областей // Режим установки закреплённых областей
this.isFrozenAnchorMode = t.targetInfo.target; this.isFrozenAnchorMode = t.targetInfo.target;
t._moveFrozenAnchorHandle(event, t.targetInfo); t._moveFrozenAnchorHandle(event, t.targetInfo);
...@@ -1324,7 +1321,7 @@ ...@@ -1324,7 +1321,7 @@
} else { } else {
if (t.isFormulaEditMode) { if (t.isFormulaEditMode) {
// !!! в зависимости от цели делаем разные действия - либо селектим область либо мувим существующий диапазон // !!! в зависимости от цели делаем разные действия - либо селектим область либо мувим существующий диапазон
if ( t.targetInfo && t.targetInfo.target === "moveResizeRange" && false === this.settings.isViewerMode ){ if ( t.targetInfo && t.targetInfo.target === c_oTargetType.MoveResizeRange && false === this.settings.isViewerMode ){
this.isMoveResizeRange = true; this.isMoveResizeRange = true;
t._moveResizeRangeHandle(event, t.targetInfo); t._moveResizeRangeHandle(event, t.targetInfo);
return; return;
...@@ -1355,7 +1352,7 @@ ...@@ -1355,7 +1352,7 @@
if (2 === event.button) { if (2 === event.button) {
t.handlers.trigger("changeSelectionRightClick", coord.x, coord.y); t.handlers.trigger("changeSelectionRightClick", coord.x, coord.y);
} else { } else {
if (t.targetInfo && t.targetInfo.target === "fillhandle" && false === this.settings.isViewerMode){ if (t.targetInfo && t.targetInfo.target === c_oTargetType.FillHandle && false === this.settings.isViewerMode){
// В режиме автозаполнения // В режиме автозаполнения
t.isFillHandleMode = true; t.isFillHandleMode = true;
t._changeFillHandle(event); t._changeFillHandle(event);
......
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
this.model.handlers.add("setDocumentModified", function (bIsModified) { this.model.handlers.add("setDocumentModified", function (bIsModified) {
self.handlers.trigger("asc_onDocumentModifiedChanged", bIsModified); self.handlers.trigger("asc_onDocumentModifiedChanged", bIsModified);
}); });
this.model.handlers.add("initCommentsToSave", function (bIsModified) { this.model.handlers.add("initCommentsToSave", function () {
self._initCommentsToSave(); self._initCommentsToSave();
}); });
this.model.handlers.add("replaceWorksheet", function (from, to) { this.model.handlers.add("replaceWorksheet", function (from, to) {
...@@ -639,7 +639,7 @@ ...@@ -639,7 +639,7 @@
var ct = ws.getCursorTypeFromXY(x, y, this.controller.settings.isViewerMode); var ct = ws.getCursorTypeFromXY(x, y, this.controller.settings.isViewerMode);
if ("hyperlink" === ct.target) { if (c_oTargetType.Hyperlink === ct.target) {
// Проверим замерженность // Проверим замерженность
var isHyperlinkClick = false; var isHyperlinkClick = false;
if ((ar.c1 === ar.c2 && ar.r1 === ar.r2) || isSelectOnShape) if ((ar.c1 === ar.c2 && ar.r1 === ar.r2) || isSelectOnShape)
...@@ -697,38 +697,38 @@ ...@@ -697,38 +697,38 @@
// Отправление эвента об удалении всего листа (именно удалении, т.к. если просто залочен, то не рисуем рамку вокруг) // Отправление эвента об удалении всего листа (именно удалении, т.к. если просто залочен, то не рисуем рамку вокруг)
if (undefined !== ct.userIdAllSheet) { if (undefined !== ct.userIdAllSheet) {
arrMouseMoveObjects.push(asc_CMM({type: c_oAscMouseMoveType.LockedObject, x: ct.lockAllPosLeft, arrMouseMoveObjects.push(new asc_CMM({type: c_oAscMouseMoveType.LockedObject, x: ct.lockAllPosLeft,
y: ct.lockAllPosTop, userId: ct.userIdAllSheet, y: ct.lockAllPosTop, userId: ct.userIdAllSheet,
lockedObjectType: c_oAscMouseMoveLockedObjectType.Sheet})); lockedObjectType: c_oAscMouseMoveLockedObjectType.Sheet}));
} else { } else {
// Отправление эвента о залоченности свойств всего листа (только если не удален весь лист) // Отправление эвента о залоченности свойств всего листа (только если не удален весь лист)
if (undefined !== ct.userIdAllProps) { if (undefined !== ct.userIdAllProps) {
arrMouseMoveObjects.push(asc_CMM({type: c_oAscMouseMoveType.LockedObject, x: ct.lockAllPosLeft, arrMouseMoveObjects.push(new asc_CMM({type: c_oAscMouseMoveType.LockedObject, x: ct.lockAllPosLeft,
y: ct.lockAllPosTop, userId: ct.userIdAllProps, y: ct.lockAllPosTop, userId: ct.userIdAllProps,
lockedObjectType: c_oAscMouseMoveLockedObjectType.TableProperties})); lockedObjectType: c_oAscMouseMoveLockedObjectType.TableProperties}));
} }
} }
// Отправление эвента о наведении на залоченный объект // Отправление эвента о наведении на залоченный объект
if (undefined !== ct.userId) { if (undefined !== ct.userId) {
arrMouseMoveObjects.push(asc_CMM({type: c_oAscMouseMoveType.LockedObject, x: ct.lockRangePosLeft, arrMouseMoveObjects.push(new asc_CMM({type: c_oAscMouseMoveType.LockedObject, x: ct.lockRangePosLeft,
y: ct.lockRangePosTop, userId: ct.userId, y: ct.lockRangePosTop, userId: ct.userId,
lockedObjectType: c_oAscMouseMoveLockedObjectType.Range})); lockedObjectType: c_oAscMouseMoveLockedObjectType.Range}));
} }
// Проверяем комментарии ячейки // Проверяем комментарии ячейки
if (undefined !== ct.commentIndexes) { if (undefined !== ct.commentIndexes) {
arrMouseMoveObjects.push(asc_CMM({type: c_oAscMouseMoveType.Comment, arrMouseMoveObjects.push(new asc_CMM({type: c_oAscMouseMoveType.Comment,
x: ct.commentCoords.asc_getLeftPX(), reverseX: ct.commentCoords.asc_getReverseLeftPX(), y: ct.commentCoords.asc_getTopPX(), x: ct.commentCoords.asc_getLeftPX(), reverseX: ct.commentCoords.asc_getReverseLeftPX(), y: ct.commentCoords.asc_getTopPX(),
aCommentIndexes: ct.commentIndexes})); aCommentIndexes: ct.commentIndexes}));
} }
// Проверяем гиперссылку // Проверяем гиперссылку
if (ct.target === "hyperlink") { if (ct.target === c_oTargetType.Hyperlink) {
if (true === ctrlKey) { if (true === ctrlKey) {
// Мы без нажатия на гиперлинк // Мы без нажатия на гиперлинк
} else { } else {
ct.cursor = ct.cellCursor.cursor; ct.cursor = ct.cellCursor.cursor;
} }
arrMouseMoveObjects.push(asc_CMM({type: c_oAscMouseMoveType.Hyperlink, x: x, y: y, arrMouseMoveObjects.push(new asc_CMM({type: c_oAscMouseMoveType.Hyperlink, x: x, y: y,
hyperlink: ct.hyperlink})); hyperlink: ct.hyperlink}));
} }
...@@ -737,19 +737,19 @@ ...@@ -737,19 +737,19 @@
*/ */
if (0 === arrMouseMoveObjects.length) { if (0 === arrMouseMoveObjects.length) {
// Отправляем эвент, что мы ни на какой области // Отправляем эвент, что мы ни на какой области
arrMouseMoveObjects.push(asc_CMM({type: c_oAscMouseMoveType.None})); arrMouseMoveObjects.push(new asc_CMM({type: c_oAscMouseMoveType.None}));
} }
// Отсылаем эвент с объектами // Отсылаем эвент с объектами
this.handlers.trigger("asc_onMouseMove", arrMouseMoveObjects); this.handlers.trigger("asc_onMouseMove", arrMouseMoveObjects);
if(ct.target === "moveRange" && ctrlKey && ct.cursor == "move"){ if(ct.target === c_oTargetType.MoveRange && ctrlKey && ct.cursor == "move"){
ct.cursor = "copy"; ct.cursor = "copy";
} }
if (canvasElem.style.cursor !== ct.cursor) { if (canvasElem.style.cursor !== ct.cursor) {
canvasElem.style.cursor = ct.cursor; canvasElem.style.cursor = ct.cursor;
} }
if (ct.target === "colheader" || ct.target === "rowheader") { if (ct.target === c_oTargetType.ColumnHeader || ct.target === c_oTargetType.RowHeader) {
ws.drawHighlightedHeaders(ct.col, ct.row); ws.drawHighlightedHeaders(ct.col, ct.row);
} else { } else {
ws.cleanHighlightedHeaders(); ws.cleanHighlightedHeaders();
...@@ -759,9 +759,9 @@ ...@@ -759,9 +759,9 @@
}; };
WorkbookView.prototype._onResizeElement = function (target, x, y) { WorkbookView.prototype._onResizeElement = function (target, x, y) {
if (target.target === "colresize") { if (target.target === c_oTargetType.ColumnResize) {
this.getWorksheet().drawColumnGuides(target.col, x, y, target.mouseX); this.getWorksheet().drawColumnGuides(target.col, x, y, target.mouseX);
} else if (target.target === "rowresize") { } else if (target.target === c_oTargetType.RowResize) {
this.getWorksheet().drawRowGuides(target.row, x, y, target.mouseY); this.getWorksheet().drawRowGuides(target.row, x, y, target.mouseY);
} }
}; };
...@@ -770,9 +770,9 @@ ...@@ -770,9 +770,9 @@
var ws = this.getWorksheet(); var ws = this.getWorksheet();
if (isResizeModeMove) { if (isResizeModeMove) {
ws.objectRender.saveSizeDrawingObjects(); ws.objectRender.saveSizeDrawingObjects();
if (target.target === "colresize") { if (target.target === c_oTargetType.ColumnResize) {
ws.changeColumnWidth(target.col, x, target.mouseX); ws.changeColumnWidth(target.col, x, target.mouseX);
} else if (target.target === "rowresize") { } else if (target.target === c_oTargetType.RowResize) {
ws.changeRowHeight(target.row, y, target.mouseY); ws.changeRowHeight(target.row, y, target.mouseY);
} }
ws.objectRender.updateSizeDrawingObjects(); ws.objectRender.updateSizeDrawingObjects();
...@@ -918,15 +918,16 @@ ...@@ -918,15 +918,16 @@
var ws = this.getWorksheet(); var ws = this.getWorksheet();
var ct = ws.getCursorTypeFromXY(x, y, this.controller.settings.isViewerMode); var ct = ws.getCursorTypeFromXY(x, y, this.controller.settings.isViewerMode);
if (ct.target === "colresize" || ct.target === "rowresize") { if (ct.target === c_oTargetType.ColumnResize || ct.target === c_oTargetType.RowResize) {
ct.target === "colresize" ? ws.optimizeColWidth(ct.col) : ws.optimizeRowHeight(ct.row); ct.target === c_oTargetType.ColumnResize ? ws.optimizeColWidth(ct.col) : ws.optimizeRowHeight(ct.row);
asc_applyFunction(callback); asc_applyFunction(callback);
} else { } else {
if (ct.col >=0 && ct.row >= 0) if (ct.col >=0 && ct.row >= 0)
this.controller.setStrictClose(!ws._isCellEmptyText(ct.col, ct.row)); this.controller.setStrictClose(!ws._isCellEmptyText(ct.col, ct.row));
// Для нажатия на колонку/строку/all обрабатывать dblClick не нужно // Для нажатия на колонку/строку/all обрабатывать dblClick не нужно
if ("colheader" === ct.target || "rowheader" === ct.target || "corner" === ct.target) { if (c_oTargetType.ColumnHeader === ct.target || c_oTargetType.RowHeader === ct.target ||
c_oTargetType.Corner === ct.target) {
asc_applyFunction(callback); asc_applyFunction(callback);
return; return;
} }
......
...@@ -5465,7 +5465,7 @@ ...@@ -5465,7 +5465,7 @@
} }
} }
if (cursor) { if (cursor) {
return {cursor: cursor, target: "moveResizeRange", col: col, row: row, return {cursor: cursor, target: c_oTargetType.MoveResizeRange, col: col, row: row,
formulaRange: oFormulaRange, indexFormulaRange: i, targetArr: targetArr}; formulaRange: oFormulaRange, indexFormulaRange: i, targetArr: targetArr};
} }
} }
...@@ -5497,7 +5497,7 @@ ...@@ -5497,7 +5497,7 @@
WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) { WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) {
var c, r, f, i, offsetX, offsetY, cellCursor, sheetId = this.model.getId(), userId, var c, r, f, i, offsetX, offsetY, cellCursor, sheetId = this.model.getId(), userId,
lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink, widthDiff = 0, heightDiff = 0, lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink, widthDiff = 0, heightDiff = 0,
isLocked = false, ar = this.activeRange, target = "cells", row = -1, col = -1, isSelGraphicObject; isLocked = false, ar = this.activeRange, target = c_oTargetType.Cells, row = -1, col = -1, isSelGraphicObject;
var frozenCursor = this._isFrozenAnchor(x, y); var frozenCursor = this._isFrozenAnchor(x, y);
if (frozenCursor.result) { if (frozenCursor.result) {
...@@ -5516,7 +5516,7 @@ ...@@ -5516,7 +5516,7 @@
var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y); var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y);
if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState)) if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState))
return {cursor: kCurFillHandle, target: "shape", col: -1, row: -1}; return {cursor: kCurFillHandle, target: c_oTargetType.Shape, col: -1, row: -1};
if (drawingInfo && drawingInfo.id) { if (drawingInfo && drawingInfo.id) {
// Возможно картинка с lock // Возможно картинка с lock
...@@ -5538,12 +5538,12 @@ ...@@ -5538,12 +5538,12 @@
else else
oHyperlink.Hyperlink = drawingInfo.hyperlink.Value; oHyperlink.Hyperlink = drawingInfo.hyperlink.Value;
cellCursor = {cursor: drawingInfo.cursor, target: "cells", col: -1, row: -1, userId: userId}; cellCursor = {cursor: drawingInfo.cursor, target: c_oTargetType.Cells, col: -1, row: -1, userId: userId};
return {cursor: kCurHyperlink, target: "hyperlink", return {cursor: kCurHyperlink, target: c_oTargetType.Hyperlink,
hyperlink: new asc_CHyperlink(oHyperlink), cellCursor: cellCursor, userId: userId}; hyperlink: new asc_CHyperlink(oHyperlink), cellCursor: cellCursor, userId: userId};
} }
return {cursor: drawingInfo.cursor, target: "shape", drawingId: drawingInfo.id, col: -1, row: -1, return {cursor: drawingInfo.cursor, target: c_oTargetType.Shape, drawingId: drawingInfo.id, col: -1, row: -1,
userId: userId, lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop}; userId: userId, lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop};
} }
...@@ -5554,23 +5554,23 @@ ...@@ -5554,23 +5554,23 @@
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) {
target = "rowheader"; target = c_oTargetType.RowHeader;
row = r.row; row = r.row;
} }
} }
if (y <= this.cellsTop && x >= this.cellsLeft) { if (y <= this.cellsTop && x >= this.cellsLeft) {
c = this._findColUnderCursor(x, true); c = this._findColUnderCursor(x, true);
if (c !== null) { if (c !== null) {
target = "colheader"; target = c_oTargetType.ColumnHeader;
col = c.col; col = c.col;
} }
} }
return {cursor: kCurFormatPainter, target: target, col: col, row: row}; return {cursor: kCurFormatPainter, target: target, col: col, row: row};
} }
var oResDefault = {cursor: kCurDefault, target: "none", col: -1, row: -1}; var oResDefault = {cursor: kCurDefault, target: c_oTargetType.None, col: -1, row: -1};
if (x < this.cellsLeft && y < this.cellsTop) { if (x < this.cellsLeft && y < this.cellsTop) {
return {cursor: kCurCorner, target: "corner", col: -1, row: -1}; return {cursor: kCurCorner, target: c_oTargetType.Corner, col: -1, row: -1};
} }
if (x <= this.cellsLeft && y >= this.cellsTop) { if (x <= this.cellsLeft && y >= this.cellsTop) {
r = this._findRowUnderCursor(y, true); r = this._findRowUnderCursor(y, true);
...@@ -5580,7 +5580,7 @@ ...@@ -5580,7 +5580,7 @@
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3) // ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return { return {
cursor: f ? kCurRowResize : kCurRowSelect, cursor: f ? kCurRowResize : kCurRowSelect,
target: f ? "rowresize" : "rowheader", target: f ? c_oTargetType.RowResize : c_oTargetType.RowHeader,
col: -1, col: -1,
row: r.row + (r.row !== this.visibleRange.r1 && f && y < r.top + 3 ? -1 : 0), row: r.row + (r.row !== this.visibleRange.r1 && f && y < r.top + 3 ? -1 : 0),
mouseY: f ? ((y < r.top + 3) ? (r.top - y - this.height_1px): (r.bottom - y - this.height_1px)) : null mouseY: f ? ((y < r.top + 3) ? (r.top - y - this.height_1px): (r.bottom - y - this.height_1px)) : null
...@@ -5594,7 +5594,7 @@ ...@@ -5594,7 +5594,7 @@
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3) // ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return { return {
cursor: f ? kCurColResize : kCurColSelect, cursor: f ? kCurColResize : kCurColSelect,
target: f ? "colresize" : "colheader", target: f ? c_oTargetType.ColumnResize : c_oTargetType.ColumnHeader,
col: c.col + (c.col !== this.visibleRange.c1 && f && x < c.left + 3 ? -1 : 0), col: c.col + (c.col !== this.visibleRange.c1 && f && x < c.left + 3 ? -1 : 0),
row: -1, row: -1,
mouseX: f ? ((x < c.left + 3) ? (c.left - x - this.width_1px): (c.right - x - this.width_1px)) : null mouseX: f ? ((x < c.left + 3) ? (c.left - x - this.width_1px): (c.right - x - this.width_1px)) : null
...@@ -5603,7 +5603,7 @@ ...@@ -5603,7 +5603,7 @@
var autoFilterInfo = this.autoFilters.checkCursor(x, y); var autoFilterInfo = this.autoFilters.checkCursor(x, y);
if (autoFilterInfo) if (autoFilterInfo)
return {cursor: kCurAutoFilter, target: "aFilterObject", col: -1, row: -1, idFilter: autoFilterInfo.id}; return {cursor: kCurAutoFilter, target: c_oTargetType.FilterObject, col: -1, row: -1, idFilter: autoFilterInfo.id};
offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft; offsetX = this.cols[this.visibleRange.c1].left - this.cellsLeft;
offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop; offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
...@@ -5632,14 +5632,14 @@ ...@@ -5632,14 +5632,14 @@
x >= (this.fillHandleL - fillHandleEpsilon) && x <= (this.fillHandleR + fillHandleEpsilon) && x >= (this.fillHandleL - fillHandleEpsilon) && x <= (this.fillHandleR + fillHandleEpsilon) &&
y >= (this.fillHandleT - fillHandleEpsilon) && y <= (this.fillHandleB + fillHandleEpsilon)) { y >= (this.fillHandleT - fillHandleEpsilon) && y <= (this.fillHandleB + fillHandleEpsilon)) {
// Мы на "квадрате" для автозаполнения // Мы на "квадрате" для автозаполнения
return {cursor: kCurFillHandle, target: "fillhandle", col: -1, row: -1}; return {cursor: kCurFillHandle, target: c_oTargetType.FillHandle, col: -1, row: -1};
} }
// Навели на выделение // Навели на выделение
var xWithOffset = x + offsetX; var xWithOffset = x + offsetX;
var yWithOffset = y + offsetY; var yWithOffset = y + offsetY;
if (this._isCursorOnSelectionBorder(ar, this.visibleRange, xWithOffset, yWithOffset)) if (this._isCursorOnSelectionBorder(ar, this.visibleRange, xWithOffset, yWithOffset))
return {cursor: kCurMove, target: "moveRange", col: -1, row: -1}; return {cursor: kCurMove, target: c_oTargetType.MoveRange, col: -1, row: -1};
} }
if (x > this.cellsLeft && y > this.cellsTop) { if (x > this.cellsLeft && y > this.cellsTop) {
...@@ -5731,14 +5731,14 @@ ...@@ -5731,14 +5731,14 @@
// Проверим, может мы в гиперлинке // Проверим, может мы в гиперлинке
oHyperlink = this.model.getHyperlinkByCell(r.row, c.col); oHyperlink = this.model.getHyperlinkByCell(r.row, c.col);
cellCursor = {cursor: kCurCells, target: "cells", col: (c ? c.col : -1), cellCursor = {cursor: kCurCells, target: c_oTargetType.Cells, col: (c ? c.col : -1),
row: (r ? r.row : -1), userId: userId, row: (r ? r.row : -1), userId: userId,
lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop, lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop,
userIdAllProps: userIdAllProps, lockAllPosLeft: lockAllPosLeft, userIdAllProps: userIdAllProps, lockAllPosLeft: lockAllPosLeft,
lockAllPosTop: lockAllPosTop, userIdAllSheet: userIdAllSheet, lockAllPosTop: lockAllPosTop, userIdAllSheet: userIdAllSheet,
commentIndexes: indexes, commentCoords: coords}; commentIndexes: indexes, commentCoords: coords};
if (null !== oHyperlink) { if (null !== oHyperlink) {
return {cursor: kCurHyperlink, target: "hyperlink", return {cursor: kCurHyperlink, target: c_oTargetType.Hyperlink,
hyperlink: new asc_CHyperlink(oHyperlink), cellCursor: cellCursor, hyperlink: new asc_CHyperlink(oHyperlink), cellCursor: cellCursor,
userId: userId, lockRangePosLeft: lockRangePosLeft, userId: userId, lockRangePosLeft: lockRangePosLeft,
lockRangePosTop: lockRangePosTop, userIdAllProps: userIdAllProps, lockRangePosTop: lockRangePosTop, userIdAllProps: userIdAllProps,
......
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