From b27b56cc07ca86bccc3b705302f15ff1d252c504 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 10 Sep 2024 21:56:05 +0300 Subject: [PATCH] [DE] Fix pdf-forms --- apps/documenteditor/main/app/controller/FormsTab.js | 3 ++- apps/documenteditor/main/app/view/FormsTab.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index a0df61aee0..2b83e085e6 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -95,7 +95,8 @@ define([ this.appConfig = config.config; this.view = this.createView('FormsTab', { toolbar: this.toolbar.toolbar, - config: config.config + config: config.config, + api: this.api }); var dirRight = Common.UI.isRTL() ? 'left' : 'right', dirLeft = Common.UI.isRTL() ? 'right' : 'left', diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index e5394990b9..33811f9305 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -263,6 +263,7 @@ define([ Common.UI.BaseView.prototype.initialize.call(this); this.toolbar = options.toolbar; this.appConfig = options.config; + this.api = options.api; this.paragraphControls = []; this._state = {}; @@ -285,9 +286,9 @@ define([ if (/(^[0-9]+$)/.test(value)) { value = parseInt(value); if (value===undefined || value===null || value<1) - me.fieldPages.setValue(me.api.getCurrentPage()+1); + me.fieldPages.setValue((me.api ? me.api.getCurrentPage() : 0)+1); } else - me.fieldPages.setValue(me.api.getCurrentPage()+1); + me.fieldPages.setValue((me.api ? me.api.getCurrentPage() : 0)+1); return true; }