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; }