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;
}
},
//попал ли курсор на кнопку фильтра
isButtonAFClick: function(x,y)
{
if(!this.allButtonAF)
checkCursor: function (x, y) {
if (!this.allButtonAF)
return false;
var ws = this.worksheet;
var buttons = this.allButtonAF;
var kof = 96 / 72;
var zoom = ws.getZoom();
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)
{
return 'pointer';
var offset = ws.getCellsOffset(1/*pt*/);
var width = 11.25;
var height = 11.25;
var button;
for (var i = 0; i < this.allButtonAF.length; i++) {
button = this.allButtonAF[i];
var x1 = button.x;
var x2 = button.x + width;
var y1 = button.y;
var y2 = button.y + height;
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 false;
},
//клик по кнопке конкретного фильтра
autoFocusClick: function(x,y)
{
onAutoFilterClick: function (idFilter) {
if(!this.allButtonAF)
return;
var ws = this.worksheet;
var buttons = this.allButtonAF;
var kof = 96 / 72;
var zoom = ws.getZoom();
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;
}
}
this._showAutoFilterDialog(this.allButtonAF[idFilter], kof);
},
drawAutoF: function (updatedRange, offsetX, offsetY) {
......
......@@ -598,10 +598,8 @@
});
};
asc_CEventsController.prototype._autoFiltersClick = function (event) {
var t = this;
var coord = t._getCoordinates(event);
this.handlers.trigger("autoFiltersClick", coord.x, coord.y);
asc_CEventsController.prototype._autoFiltersClick = function (idFilter) {
this.handlers.trigger("autoFiltersClick", idFilter);
};
asc_CEventsController.prototype._commentCellClick = function (event) {
......@@ -1247,7 +1245,7 @@
return;
}
else if (t.targetInfo && (t.targetInfo.target === "aFilterObject")) {
t._autoFiltersClick(event);
t._autoFiltersClick(t.targetInfo.idFilter);
return;
}
else if (t.targetInfo && (undefined !== t.targetInfo.commentIndexes) && (false === this.settings.isViewerMode)) {
......
......@@ -778,9 +778,8 @@
ws._applyFrozenAnchor(x, y, targetInfo, false);
};
WorkbookView.prototype._onAutoFiltersClick = function (x, y) {
var ws = this.getWorksheet();
ws.autoFilters.autoFocusClick(x,y);
WorkbookView.prototype._onAutoFiltersClick = function (idFilter) {
this.getWorksheet().autoFilters.onAutoFilterClick(idFilter);
};
WorkbookView.prototype._onCommentCellClick = function (x, y) {
......
......@@ -94,6 +94,7 @@
var kCurMove = "move";
var kCurSEResize = "se-resize";
var kCurNEResize = "ne-resize";
var kCurAutoFilter = "pointer";
// ToDo стоит перенести в common-ы
var kCurFormatPainter = "";
......@@ -5409,16 +5410,13 @@
WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) {
var c, r, f, i, offsetX, offsetY, arIntersection, left, top, right, bottom, cellCursor,
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);
if (frozenCursor.result) {
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);
if (asc["editor"].isStartAddShape && CheckIdSatetShapeAdd(this.objectRender.controller.curState.id))
return {cursor: kCurFillHandle, target: "shape", col: -1, row: -1};
......@@ -5452,13 +5450,31 @@
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());
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;
offsetY = this.rows[this.visibleRange.r1].top - this.cellsTop;
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