Commit 571e34d6 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил нажатие на кнопку автофильтра и определение курсора над кнопкой.

Поправил при "формате по образцу" наведение на столбцы/строки.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54832 954022d7-b5bf-4e40-9824-e11837661b57
parent 95d4145a
...@@ -1212,51 +1212,33 @@ var gUndoInsDelCellsFlag = true; ...@@ -1212,51 +1212,33 @@ var gUndoInsDelCellsFlag = true;
} }
}, },
//попал ли курсор на кнопку фильтра //попал ли курсор на кнопку фильтра
isButtonAFClick: function(x,y) checkCursor: function (x, y) {
{ if (!this.allButtonAF)
if(!this.allButtonAF)
return false; return false;
var ws = this.worksheet; var ws = this.worksheet;
var buttons = this.allButtonAF; var offset = ws.getCellsOffset(1/*pt*/);
var kof = 96 / 72; var width = 11.25;
var zoom = ws.getZoom(); var height = 11.25;
var width = 13*zoom;
var height = 13*zoom; var button;
for(var i = 0; i < buttons.length; i++) for (var i = 0; i < this.allButtonAF.length; i++) {
{ button = this.allButtonAF[i];
var width2 = (buttons[i].x)*kof + width; var x1 = button.x;
var width1 = (buttons[i].x)*kof; var x2 = button.x + width;
var height1 = (buttons[i].y)*kof; var y1 = button.y;
var height2 = (buttons[i].y + height)*kof; var y2 = button.y + height;
if(x >= width1 && x <= width2 && y >= height1 && y <= height2 && height1 >= ws.rows[0].top && width1 >= ws.cols[0].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 'pointer';
} }
} }
return false;
}, },
//клик по кнопке конкретного фильтра //клик по кнопке конкретного фильтра
autoFocusClick: function(x,y) onAutoFilterClick: function (idFilter) {
{
if(!this.allButtonAF) if(!this.allButtonAF)
return; return;
var ws = this.worksheet;
var buttons = this.allButtonAF;
var kof = 96 / 72; var kof = 96 / 72;
var zoom = ws.getZoom(); this._showAutoFilterDialog(this.allButtonAF[idFilter], kof);
var width = 13*zoom;
var height = 13*zoom;
for(var i = 0; i < buttons.length; i++)
{
var width2 = (buttons[i].x)*kof + width;
var width1 = (buttons[i].x)*kof;
var height1 = (buttons[i].y)*kof;
var height2 = (buttons[i].y + height)*kof;
if(x >= width1 && x <= width2 && y >= height1 && y <= height2 && height1 >= ws.rows[0].top && width1 >= ws.cols[0].left)
{
this._showAutoFilterDialog(buttons[i],kof);
return;
}
}
}, },
drawAutoF: function (updatedRange, offsetX, offsetY) { drawAutoF: function (updatedRange, offsetX, offsetY) {
......
...@@ -598,10 +598,8 @@ ...@@ -598,10 +598,8 @@
}); });
}; };
asc_CEventsController.prototype._autoFiltersClick = function (event) { asc_CEventsController.prototype._autoFiltersClick = function (idFilter) {
var t = this; this.handlers.trigger("autoFiltersClick", idFilter);
var coord = t._getCoordinates(event);
this.handlers.trigger("autoFiltersClick", coord.x, coord.y);
}; };
asc_CEventsController.prototype._commentCellClick = function (event) { asc_CEventsController.prototype._commentCellClick = function (event) {
...@@ -1247,7 +1245,7 @@ ...@@ -1247,7 +1245,7 @@
return; return;
} }
else if (t.targetInfo && (t.targetInfo.target === "aFilterObject")) { else if (t.targetInfo && (t.targetInfo.target === "aFilterObject")) {
t._autoFiltersClick(event); 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)) {
......
...@@ -778,9 +778,8 @@ ...@@ -778,9 +778,8 @@
ws._applyFrozenAnchor(x, y, targetInfo, false); ws._applyFrozenAnchor(x, y, targetInfo, false);
}; };
WorkbookView.prototype._onAutoFiltersClick = function (x, y) { WorkbookView.prototype._onAutoFiltersClick = function (idFilter) {
var ws = this.getWorksheet(); this.getWorksheet().autoFilters.onAutoFilterClick(idFilter);
ws.autoFilters.autoFocusClick(x,y);
}; };
WorkbookView.prototype._onCommentCellClick = function (x, y) { WorkbookView.prototype._onCommentCellClick = function (x, y) {
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
var kCurMove = "move"; var kCurMove = "move";
var kCurSEResize = "se-resize"; var kCurSEResize = "se-resize";
var kCurNEResize = "ne-resize"; var kCurNEResize = "ne-resize";
var kCurAutoFilter = "pointer";
// ToDo стоит перенести в common-ы // ToDo стоит перенести в common-ы
var kCurFormatPainter = ""; var kCurFormatPainter = "";
...@@ -5409,16 +5410,13 @@ ...@@ -5409,16 +5410,13 @@
WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) { WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) {
var c, r, f, i, offsetX, offsetY, arIntersection, left, top, right, bottom, cellCursor, var c, r, f, i, offsetX, offsetY, arIntersection, left, top, right, bottom, cellCursor,
sheetId = this.model.getId(), userId, lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink, sheetId = this.model.getId(), userId, lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink,
widthDiff = 0, heightDiff = 0, isLocked = false, ar = this.activeRange; widthDiff = 0, heightDiff = 0, isLocked = false, ar = this.activeRange, target = "cells", row = -1, col = -1;
var frozenCursor = this._isFrozenAnchor(x, y); var frozenCursor = this._isFrozenAnchor(x, y);
if (frozenCursor.result) { if (frozenCursor.result) {
return {cursor: frozenCursor.cursor, target: frozenCursor.name, col: -1, row: -1}; return {cursor: frozenCursor.cursor, target: frozenCursor.name, col: -1, row: -1};
} }
if (this.isFormatPainter)
return {cursor: kCurFormatPainter, target: "cells"};
var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y); var drawingInfo = this.objectRender.checkCursorDrawingObject(x, y);
if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState.id)) if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState.id))
return {cursor: kCurFillHandle, target: "shape", col: -1, row: -1}; return {cursor: kCurFillHandle, target: "shape", col: -1, row: -1};
...@@ -5452,13 +5450,31 @@ ...@@ -5452,13 +5450,31 @@
userId: userId, lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop}; userId: userId, lockRangePosLeft: lockRangePosLeft, lockRangePosTop: lockRangePosTop};
} }
var autoFilterCursor = this.autoFilters.isButtonAFClick(x, y);
if (autoFilterCursor)
return {cursor: autoFilterCursor, target: "aFilterObject", col: -1, row: -1};
x *= asc_getcvt(0/*px*/, 1/*pt*/, this._getPPIX()); x *= asc_getcvt(0/*px*/, 1/*pt*/, this._getPPIX());
y *= asc_getcvt(0/*px*/, 1/*pt*/, this._getPPIY()); y *= asc_getcvt(0/*px*/, 1/*pt*/, this._getPPIY());
if (this.isFormatPainter) {
if (x <= this.cellsLeft && y >= this.cellsTop) {
r = this._findRowUnderCursor(y, true);
if (r !== null) {
target = "rowheader";
row = r.row;
}
}
if (y <= this.cellsTop && x >= this.cellsLeft) {
c = this._findColUnderCursor(x, true);
if (c !== null) {
target = "colheader";
col = c.col;
}
}
return {cursor: kCurFormatPainter, target: target, col: col, row: row};
}
var autoFilterInfo = this.autoFilters.checkCursor(x, y);
if (autoFilterInfo)
return {cursor: kCurAutoFilter, target: "aFilterObject", 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;
if (this.topLeftFrozenCell) { if (this.topLeftFrozenCell) {
......
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