Commit 63d5c00a authored by Alexander.Trofimov's avatar Alexander.Trofimov

check idle in spreadsheets

parent 26d9821e
...@@ -600,6 +600,7 @@ ...@@ -600,6 +600,7 @@
"closed": function () { "closed": function () {
self._onCloseCellEditor.apply(self, arguments); self._onCloseCellEditor.apply(self, arguments);
}, "updated": function () { }, "updated": function () {
self.Api.checkLastWork();
self._onUpdateCellEditor.apply(self, arguments); self._onUpdateCellEditor.apply(self, arguments);
}, "gotFocus": function (hasFocus) { }, "gotFocus": function (hasFocus) {
self.controller.setFocus(!hasFocus); self.controller.setFocus(!hasFocus);
...@@ -664,64 +665,63 @@ ...@@ -664,64 +665,63 @@
}); });
this.wsViewHandlers = new AscCommonExcel.asc_CHandlersList(/*handlers*/{ this.wsViewHandlers = new AscCommonExcel.asc_CHandlersList(/*handlers*/{
"getViewerMode": function() { "getViewerMode": function () {
return self.controller.getViewerMode ? self.controller.getViewerMode() : true; return self.controller.getViewerMode ? self.controller.getViewerMode() : true;
}, "reinitializeScroll": function() { }, "reinitializeScroll": function () {
self.controller.reinitializeScroll(/*All*/); self.controller.reinitializeScroll(/*All*/);
}, "reinitializeScrollY": function() { }, "reinitializeScrollY": function () {
self.controller.reinitializeScroll(/*vertical*/1); self.controller.reinitializeScroll(/*vertical*/1);
}, "reinitializeScrollX": function() { }, "reinitializeScrollX": function () {
self.controller.reinitializeScroll(/*horizontal*/2); self.controller.reinitializeScroll(/*horizontal*/2);
}, "selectionChanged": function() { }, "selectionChanged": function () {
self._onWSSelectionChanged(); self._onWSSelectionChanged();
}, "selectionNameChanged": function() { }, "selectionNameChanged": function () {
self._onSelectionNameChanged.apply(self, arguments); self._onSelectionNameChanged.apply(self, arguments);
}, "selectionMathInfoChanged": function() { }, "selectionMathInfoChanged": function () {
self._onSelectionMathInfoChanged.apply(self, arguments); self._onSelectionMathInfoChanged.apply(self, arguments);
},'onFilterInfo': function(countFilter, countRecords) { }, 'onFilterInfo': function (countFilter, countRecords) {
self.handlers.trigger("asc_onFilterInfo", countFilter, countRecords); self.handlers.trigger("asc_onFilterInfo", countFilter, countRecords);
}, "onErrorEvent": function(errorId, level) { }, "onErrorEvent": function (errorId, level) {
self.handlers.trigger("asc_onError", errorId, level); self.handlers.trigger("asc_onError", errorId, level);
}, "slowOperation": function(isStart) { }, "slowOperation": function (isStart) {
(isStart ? self.Api.sync_StartAction : self.Api.sync_EndAction).call(self.Api, c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.SlowOperation); (isStart ? self.Api.sync_StartAction : self.Api.sync_EndAction).call(self.Api,
}, "setAutoFiltersDialog": function(arrVal) { c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.SlowOperation);
}, "setAutoFiltersDialog": function (arrVal) {
self.handlers.trigger("asc_onSetAFDialog", arrVal); self.handlers.trigger("asc_onSetAFDialog", arrVal);
}, "selectionRangeChanged": function(val) { }, "selectionRangeChanged": function (val) {
self.handlers.trigger("asc_onSelectionRangeChanged", val); self.handlers.trigger("asc_onSelectionRangeChanged", val);
}, "onRenameCellTextEnd": function(countFind, countReplace) { }, "onRenameCellTextEnd": function (countFind, countReplace) {
self.handlers.trigger("asc_onRenameCellTextEnd", countFind, countReplace); self.handlers.trigger("asc_onRenameCellTextEnd", countFind, countReplace);
}, 'onStopFormatPainter': function() { }, 'onStopFormatPainter': function () {
self._onStopFormatPainter(); self._onStopFormatPainter();
}, 'getRangeFormatPainter': function() { }, 'getRangeFormatPainter': function () {
return self.rangeFormatPainter; return self.rangeFormatPainter;
},"onDocumentPlaceChanged": function() { }, "onDocumentPlaceChanged": function () {
self._onDocumentPlaceChanged(); self._onDocumentPlaceChanged();
}, "updateSheetViewSettings": function() { }, "updateSheetViewSettings": function () {
self.handlers.trigger("asc_onUpdateSheetViewSettings"); self.handlers.trigger("asc_onUpdateSheetViewSettings");
}, "onScroll": function(d) { }, "onScroll": function (d) {
self.controller.scroll(d); self.controller.scroll(d);
}, "getLockDefNameManagerStatus": function() { }, "getLockDefNameManagerStatus": function () {
return self.defNameAllowCreate; return self.defNameAllowCreate;
}, 'isActive': function() { }, 'isActive': function () {
return (-1 === self.copyActiveSheet || self.wsActive === self.copyActiveSheet); return (-1 === self.copyActiveSheet || self.wsActive === self.copyActiveSheet);
}, }, "getCellEditMode": function () {
"getCellEditMode": function() {
return self.isCellEditMode; return self.isCellEditMode;
}, }, "drawMobileSelection": function (color) {
"drawMobileSelection" : function(color) { if (self.MobileTouchManager) {
if (self.MobileTouchManager)
{
var _canvas = self.getWorksheet().objectRender.getDrawingCanvas(); var _canvas = self.getWorksheet().objectRender.getDrawingCanvas();
if (_canvas) if (_canvas) {
self.MobileTouchManager.CheckSelect(_canvas.trackOverlay, color); self.MobileTouchManager.CheckSelect(_canvas.trackOverlay, color);
} }
}, }
"showSpecialPasteOptions": function(val) { }, "showSpecialPasteOptions": function (val) {
self.handlers.trigger("asc_onShowSpecialPasteOptions", val); self.handlers.trigger("asc_onShowSpecialPasteOptions", val);
if(!window['AscCommon'].g_clipboardBase.showSpecialPasteButton) if (!window['AscCommon'].g_clipboardBase.showSpecialPasteButton) {
{
window['AscCommon'].g_clipboardBase.showSpecialPasteButton = true; window['AscCommon'].g_clipboardBase.showSpecialPasteButton = true;
} }
}, 'checkLastWork': function () {
self.Api.checkLastWork();
} }
}); });
......
...@@ -1966,6 +1966,7 @@ ...@@ -1966,6 +1966,7 @@
if (lockDraw || this.model.workbook.bCollaborativeChanges || window['IS_NATIVE_EDITOR']) { if (lockDraw || this.model.workbook.bCollaborativeChanges || window['IS_NATIVE_EDITOR']) {
return this; return this;
} }
this.handlers.trigger("checkLastWork");
this._clean(); this._clean();
this._drawCorner(); this._drawCorner();
this._drawColumnHeaders(/*drawingCtx*/ undefined); this._drawColumnHeaders(/*drawingCtx*/ undefined);
...@@ -3736,6 +3737,8 @@ ...@@ -3736,6 +3737,8 @@
return; return;
} }
this.handlers.trigger("checkLastWork");
// set clipping rect to cells area // set clipping rect to cells area
var ctx = this.overlayCtx; var ctx = this.overlayCtx;
ctx.save().beginPath() ctx.save().beginPath()
...@@ -6031,6 +6034,7 @@ ...@@ -6031,6 +6034,7 @@
}; };
WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) { WorksheetView.prototype.getCursorTypeFromXY = function (x, y, isViewerMode) {
this.handlers.trigger("checkLastWork");
var res, c, r, f, i, offsetX, offsetY, cellCursor; var res, c, r, f, i, offsetX, offsetY, cellCursor;
var sheetId = this.model.getId(), userId, lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink; var sheetId = this.model.getId(), userId, lockRangePosLeft, lockRangePosTop, lockInfo, oHyperlink;
var widthDiff = 0, heightDiff = 0, isLocked = false, target = c_oTargetType.Cells, row = -1, col = -1, isSelGraphicObject, isNotFirst; var widthDiff = 0, heightDiff = 0, isLocked = false, target = c_oTargetType.Cells, row = -1, col = -1, isSelGraphicObject, isNotFirst;
......
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