From ed9f696043c1fab962ec288aebdd5462afe0120a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 18 Dec 2024 18:07:28 +0300 Subject: [PATCH] [PDF] Fix context menu --- apps/pdfeditor/main/app/controller/DocumentHolder.js | 6 ++++++ apps/pdfeditor/main/app/controller/DocumentHolderExt.js | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) 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);