diff --git a/apps/presentationeditor/main/app/controller/Print.js b/apps/presentationeditor/main/app/controller/Print.js index c4281ae3d3..d53272e9c5 100644 --- a/apps/presentationeditor/main/app/controller/Print.js +++ b/apps/presentationeditor/main/app/controller/Print.js @@ -31,7 +31,8 @@ */ define([ 'core', - 'presentationeditor/main/app/view/FileMenuPanels' + 'presentationeditor/main/app/view/FileMenuPanels', + 'presentationeditor/main/app/view/HeaderFooterDialog' ], function () { 'use strict'; @@ -56,7 +57,8 @@ define([ this.addListeners({ 'PrintWithPreview': { 'show': _.bind(this.onShowMainSettingsPrint, this), - 'render:after': _.bind(this.onAfterRender, this) + 'render:after': _.bind(this.onAfterRender, this), + 'openheader': _.bind(this.onOpenHeaderSettings, this) } }); }, @@ -336,6 +338,24 @@ define([ } }, + onOpenHeaderSettings: function () { + var me = this; + (new PE.Views.HeaderFooterDialog({ + api: this.api, + lang: this.api.asc_getDefaultLanguage(), + props: this.api.asc_getHeaderFooterProperties(), + type: 1, + handler: function(result, value) { + if (result == 'ok' || result == 'all') { + if (me.api) { + me.api.asc_setHeaderFooterProperties(value, result == 'all'); + } + } + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + })).show(); + }, + SetDisabled: function() { if (this.printSettings.isVisible()) { var disable = !this.mode.isEdit; diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 8177dbeca3..7349d672b1 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -447,6 +447,7 @@ define([ !this.mode.isDisconnected && this.panels['info'].updateInfo(this.document); this.panels['rights'].setMode(this.mode); !this.mode.isDisconnected && this.panels['rights'].updateInfo(this.document); + this.panels['printpreview'] && this.panels['printpreview'].setMode(this.mode); if ( this.mode.canCreateNew ) { if (this.mode.templates && this.mode.templates.length) { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 3cbc3737fe..e961216a63 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1947,6 +1947,7 @@ define([ '', '', '', + '', '', '