Commit e0cdf126 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Добавил метод asc_SetDocumentPlaceChangedEnabled и эвент...

Добавил метод asc_SetDocumentPlaceChangedEnabled и эвент asc_onDocumentPlaceChanged для меню, чтобы узнать о смене позиции документа (скролл)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55805 954022d7-b5bf-4e40-9824-e11837661b57
parent fb67784e
......@@ -1242,6 +1242,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// return null;
},
asc_SetDocumentPlaceChangedEnabled: function (val) {
this.wb.setDocumentPlaceChangedEnabled(val);
},
// Посылает эвент о том, что обновились листы
sheetsChanged: function () {
this.handlers.trigger("asc_onSheetsChanged");
......@@ -3606,6 +3610,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_getController"] = prot.asc_getController;
prot["asc_SetDocumentPlaceChangedEnabled"] = prot.asc_SetDocumentPlaceChangedEnabled;
// Toolbar interface
/*prot["asc_getEditorFonts"] = prot.asc_getEditorFonts;
......
......@@ -20,6 +20,7 @@
asc_typeOf = asc.typeOf;
/** @constructor */
function asc_CHandlersList(handlers) {
if ( !(this instanceof asc_CHandlersList) ) {
return new asc_CHandlersList(handlers);
......
......@@ -130,6 +130,9 @@
// Комментарии для всего документа
this.cellCommentator = null;
// Флаг о подписке на эвенты о смене позиции документа (скролл) для меню
this.isDocumentPlaceChangedEnabled = false;
// Максимальная ширина числа из 0,1,2...,9, померенная в нормальном шрифте(дефалтовый для книги) в px(целое)
// Ecma-376 Office Open XML Part 1, пункт 18.3.1.13
this.maxDigitWidth = 0;
......@@ -479,7 +482,6 @@
return this;
};
WorkbookView.prototype._createWorksheetView = function (wsModel) {
var self = this, opt = $.extend(true, {}, this.settings.worksheetDefaults);
return new asc_WSV(wsModel, /*handlers*/{
......@@ -498,7 +500,8 @@
"onRenameCellTextEnd" : function (countFind, countReplace) {self.handlers.trigger("asc_onRenameCellTextEnd", countFind, countReplace);},
"onStopFormatPainter" : function () {self.handlers.trigger("asc_onStopFormatPainter");},
"onChangeColumnWidth" : function (widthCC, widthPx) {self.handlers.trigger("asc_onChangeColumnWidth", widthCC, widthPx);},
"onChangeRowHeight" : function (heightPt, heightPx) {self.handlers.trigger("asc_onChangeRowHeight", heightPt, heightPx);}
"onChangeRowHeight" : function (heightPt, heightPx) {self.handlers.trigger("asc_onChangeRowHeight", heightPt, heightPx);},
"onDocumentPlaceChanged" : function () {self._onDocumentPlaceChanged();}
}, this.buffers, this.stringRender, this.maxDigitWidth, this.collaborativeEditing, opt);
};
......@@ -774,6 +777,7 @@
}
ws.objectRender.updateSizeDrawingObjects();
ws.cellCommentator.updateCommentPosition();
this._onDocumentPlaceChanged();
}
ws.draw();
};
......@@ -1107,6 +1111,11 @@
}
};
WorkbookView.prototype._onDocumentPlaceChanged = function () {
if (this.isDocumentPlaceChangedEnabled)
this.handlers.trigger("asc_onDocumentPlaceChanged");
};
WorkbookView.prototype.getTablePictures = function () {
var autoFilters = new asc.AutoFilters();
return autoFilters.getTablePictures(this.model, this.fmgrGraphics, this.m_oFont);
......@@ -1861,6 +1870,10 @@
}
};
WorkbookView.prototype.setDocumentPlaceChangedEnabled = function (val) {
this.isDocumentPlaceChangedEnabled = val;
};
/*
* @param {c_oAscRenderingModeType} mode Режим отрисовки
* @param {Boolean} isInit инициализация или нет
......
......@@ -581,6 +581,7 @@
this._prepareCellTextMetricsCache(this.visibleRange);
this._shiftVisibleRange();
this.cellCommentator.updateCommentPosition();
this.handlers.trigger("onDocumentPlaceChanged");
this.updateZoom = false;
} else {
this.updateZoom = true;
......@@ -597,6 +598,7 @@
this._prepareCellTextMetricsCache(this.visibleRange);
this._shiftVisibleRange();
this.cellCommentator.updateCommentPosition();
this.handlers.trigger("onDocumentPlaceChanged");
this.updateResize = false;
this.updateZoom = false;
......@@ -5206,6 +5208,7 @@
this.handlers.trigger("reinitializeScrollY");
this.cellCommentator.updateCommentPosition();
this.handlers.trigger("onDocumentPlaceChanged");
this.cellCommentator.drawCommentCells();
//ToDo this.drawDepCells();
this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollVertical, rangeGraphic));
......@@ -5300,6 +5303,7 @@
this.handlers.trigger("reinitializeScrollX");
this.cellCommentator.updateCommentPosition();
this.handlers.trigger("onDocumentPlaceChanged");
this.cellCommentator.drawCommentCells();
//ToDo this.drawDepCells();
this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollHorizontal, rangeGraphic));
......@@ -10371,6 +10375,7 @@
t.objectRender.rebuildChartGraphicObjects(t.activeRange.clone(true));
t.cellCommentator.updateCommentPosition();
t.handlers.trigger("onDocumentPlaceChanged");
t.draw(lockDraw);
};
......
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