Commit 5deccf1f authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Убрал излишнюю переменную isMouseDownMode

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57788 954022d7-b5bf-4e40-9824-e11837661b57
parent fa66512e
...@@ -83,8 +83,6 @@ ...@@ -83,8 +83,6 @@
this.clickCounter = new ClickCounter(); this.clickCounter = new ClickCounter();
this.isMousePressed = false; this.isMousePressed = false;
this.isShapeAction = false; this.isShapeAction = false;
// Для обработки _onMouseUp и _onWindowMouseUp
this.isMouseDownMode = false;
// Был ли DblClick обработан в onMouseDown эвенте // Был ли DblClick обработан в onMouseDown эвенте
this.isDblClickInMouseDown = false; this.isDblClickInMouseDown = false;
...@@ -130,7 +128,6 @@ ...@@ -130,7 +128,6 @@
} }
/*раньше события на ресайз вызывался из меню через контроллер. теперь контроллер в меню не доступен, для ресайза подписываемся на глобальный ресайз от window.*/ /*раньше события на ресайз вызывался из меню через контроллер. теперь контроллер в меню не доступен, для ресайза подписываемся на глобальный ресайз от window.*/
window.addEventListener("resize", function () {self._onWindowResize.apply(self, arguments);}, false); window.addEventListener("resize", function () {self._onWindowResize.apply(self, arguments);}, false);
// this.element.addEventListener("dblclick" , function () {alert("123");/*return self._onMouseDblClick.apply(self, arguments);*/} , false);
return this; return this;
} }
...@@ -302,7 +299,7 @@ ...@@ -302,7 +299,7 @@
var coord = t._getCoordinates(event); var coord = t._getCoordinates(event);
var graphicsInfo = t.handlers.trigger("getGraphicsInfo", coord.x, coord.y); var graphicsInfo = t.handlers.trigger("getGraphicsInfo", coord.x, coord.y);
if ( t.isShapeAction || graphicsInfo ) if (graphicsInfo )
return; return;
setTimeout(function () { setTimeout(function () {
...@@ -1033,8 +1030,7 @@ ...@@ -1033,8 +1030,7 @@
/** @param event {MouseEvent} */ /** @param event {MouseEvent} */
asc_CEventsController.prototype._onWindowMouseMove = function (event) { asc_CEventsController.prototype._onWindowMouseMove = function (event) {
var t = this; var coord = this._getCoordinates(event);
var coord = t._getCoordinates(event);
if (this.isSelectMode && !this.hasCursor) {this._changeSelection2(event);} if (this.isSelectMode && !this.hasCursor) {this._changeSelection2(event);}
if (this.isResizeMode && !this.hasCursor) { if (this.isResizeMode && !this.hasCursor) {
...@@ -1047,14 +1043,15 @@ ...@@ -1047,14 +1043,15 @@
this.vsbApi.mouseDown ? this.vsbApi.evt_mousemove.call(this.vsbApi,event) : false; this.vsbApi.mouseDown ? this.vsbApi.evt_mousemove.call(this.vsbApi,event) : false;
// Режим установки закреплённых областей // Режим установки закреплённых областей
if (t.isFrozenAnchorMode) { if (this.isFrozenAnchorMode) {
t._moveFrozenAnchorHandle(event, { target: t.isFrozenAnchorMode }); this._moveFrozenAnchorHandle(event, { target: this.isFrozenAnchorMode });
return true; return true;
} }
event.isLocked = t.isMousePressed; if (this.isShapeAction) {
if (t.isShapeAction && t.isMouseDownMode) event.isLocked = this.isMousePressed;
t.handlers.trigger("graphicObjectMouseMove", event, coord.x, coord.y); this.handlers.trigger("graphicObjectMouseMove", event, coord.x, coord.y);
}
return true; return true;
}; };
...@@ -1063,10 +1060,10 @@ ...@@ -1063,10 +1060,10 @@
asc_CEventsController.prototype._onWindowMouseUp = function (event) { asc_CEventsController.prototype._onWindowMouseUp = function (event) {
var coord = this._getCoordinates(event); var coord = this._getCoordinates(event);
this.isMousePressed = false;
// Shapes // Shapes
if ( this.isMouseDownMode && this.isShapeAction ) { if (this.isShapeAction) {
event.isLocked = this.isMousePressed = false; event.isLocked = this.isMousePressed;
this.isMouseDownMode = false;
event.ClickCount = this.clickCounter.clickCount; event.ClickCount = this.clickCounter.clickCount;
this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y); this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y);
this._changeSelectionDone(event); this._changeSelectionDone(event);
...@@ -1172,19 +1169,16 @@ ...@@ -1172,19 +1169,16 @@
return; return;
t.isShapeAction = true; t.isShapeAction = true;
t.isMouseDownMode = true;
t.clickCounter.mouseDownEvent(coord.x, coord.y, event.button); t.clickCounter.mouseDownEvent(coord.x, coord.y, event.button);
event.ClickCount = t.clickCounter.clickCount; event.ClickCount = t.clickCounter.clickCount;
if (event.ClickCount == 2)
if ( (event.ClickCount == 2) && t.isShapeAction )
t.isDblClickInMouseDown = true; t.isDblClickInMouseDown = true;
t.handlers.trigger("graphicObjectMouseDown", event, coord.x, coord.y); t.handlers.trigger("graphicObjectMouseDown", event, coord.x, coord.y);
t.handlers.trigger("updateSelectionShape", /*isSelectOnShape*/true); t.handlers.trigger("updateSelectionShape", /*isSelectOnShape*/true);
return; return;
} } else
else
t.isShapeAction = false; t.isShapeAction = false;
if (2 === event.detail) { if (2 === event.detail) {
...@@ -1316,17 +1310,11 @@ ...@@ -1316,17 +1310,11 @@
var coord = this._getCoordinates(event); var coord = this._getCoordinates(event);
event.isLocked = this.isMousePressed = false; event.isLocked = this.isMousePressed = false;
if ( this.isShapeAction ) { if (this.isShapeAction) {
if (this.isCellEditMode) {
this.handlers.trigger("stopCellEditing");
this.isCellEditMode = false;
}
event.ClickCount = this.clickCounter.clickCount; event.ClickCount = this.clickCounter.clickCount;
this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y); this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y);
this.isMouseDownMode = false;
this._changeSelectionDone(event); this._changeSelectionDone(event);
if(asc["editor"].isStartAddShape) { if (asc["editor"].isStartAddShape) {
event.preventDefault && event.preventDefault(); event.preventDefault && event.preventDefault();
event.stopPropagation && event.stopPropagation(); event.stopPropagation && event.stopPropagation();
} }
...@@ -1375,7 +1363,6 @@ ...@@ -1375,7 +1363,6 @@
var t = this; var t = this;
var ctrlKey = event.metaKey || event.ctrlKey; var ctrlKey = event.metaKey || event.ctrlKey;
var coord = t._getCoordinates(event); var coord = t._getCoordinates(event);
event.isLocked = t.isMousePressed;
t.hasCursor = true; t.hasCursor = true;
...@@ -1420,6 +1407,7 @@ ...@@ -1420,6 +1407,7 @@
} }
if (t.isShapeAction || graphicsInfo) { if (t.isShapeAction || graphicsInfo) {
event.isLocked = t.isMousePressed;
t.handlers.trigger("graphicObjectMouseMove", event, coord.x, coord.y); t.handlers.trigger("graphicObjectMouseMove", event, coord.x, coord.y);
t.handlers.trigger("updateWorksheet", t.element, coord.x, coord.y, ctrlKey, function(info){t.targetInfo = info;}); t.handlers.trigger("updateWorksheet", t.element, coord.x, coord.y, ctrlKey, function(info){t.targetInfo = info;});
return true; return true;
......
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