diff --git a/apps/pdfeditor/main/app/controller/DocumentHolder.js b/apps/pdfeditor/main/app/controller/DocumentHolder.js index 5fbca9b3c5..021acb6378 100644 --- a/apps/pdfeditor/main/app/controller/DocumentHolder.js +++ b/apps/pdfeditor/main/app/controller/DocumentHolder.js @@ -169,6 +169,8 @@ define([ this.api = o; if (this.api) { + (this.mode.isEdit === true) && this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onCountPages, this)); + this.documentHolder.setApi(this.api); } @@ -561,6 +563,10 @@ define([ } }, + onCountPages: function(count) { + this.documentHolder && (this.documentHolder._pagesCount = count); + }, + onDialogAddHyperlink: function() {}, onShowMathTrack: function() {}, diff --git a/apps/pdfeditor/main/app/controller/DocumentHolderExt.js b/apps/pdfeditor/main/app/controller/DocumentHolderExt.js index 63e7e24f3b..cf95da5472 100644 --- a/apps/pdfeditor/main/app/controller/DocumentHolderExt.js +++ b/apps/pdfeditor/main/app/controller/DocumentHolderExt.js @@ -68,7 +68,6 @@ define([], function () { this.api.asc_registerCallback('asc_onHideEyedropper', _.bind(this.hideEyedropper, this)); this.api.asc_registerCallback('asc_onShowPDFFormsActions', _.bind(this.onShowFormsPDFActions, this)); this.api.asc_registerCallback('asc_onHidePdfFormsActions', _.bind(this.onHidePdfFormsActions, this)); - this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onCountPages, this)); if (this.mode.canComments) { // for text this.api.asc_registerCallback('asc_onShowAnnotTextPrTrack', _.bind(this.onShowTextBar, this)); @@ -2325,10 +2324,6 @@ define([], function () { } }; - dh.onCountPages = function(count) { - this.documentHolder && (this.documentHolder._pagesCount = count); - }; - dh.onNewPage = function(item) { this.api && this.api.asc_AddPage(item.value);