diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index ec0ca3b6e..c1c70fa06 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -107,6 +107,7 @@ define([ if ( !this.leftMenu.panelHistory.isVisible() ) this.clickMenuFileItem(null, 'history'); }, this)); + Common.NotificationCenter.on('file:print', _.bind(this.clickToolbarPrint, this)); }, onLaunch: function() { @@ -534,6 +535,10 @@ define([ this.leftMenu.menuFile.hide(); }, + clickToolbarPrint: function () { + this.leftMenu.showMenu('file:printpreview'); + }, + changeToolbarSaveState: function (state) { var btnSave = this.leftMenu.menuFile.getButton('save'); btnSave && btnSave.setDisabled(state); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index b72806304..639ebe996 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2639,7 +2639,7 @@ define([ onPrint: function() { if (!this.appOptions.canPrint || Common.Utils.ModalWindow.isVisible()) return; - Common.NotificationCenter.trigger('print', this); + Common.NotificationCenter.trigger('file:print', this); }, onPrintUrl: function(url) { diff --git a/apps/spreadsheeteditor/main/app/template/FileMenu.template b/apps/spreadsheeteditor/main/app/template/FileMenu.template index a2e4c5f83..01ba748b1 100644 --- a/apps/spreadsheeteditor/main/app/template/FileMenu.template +++ b/apps/spreadsheeteditor/main/app/template/FileMenu.template @@ -7,7 +7,6 @@
- diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 8e5b5f6d8..6511ad4c1 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -129,19 +129,9 @@ define([ dataHintOffset: [2, 14] }); - this.miPrint = new Common.UI.MenuItem({ - el : $markup.elementById('#fm-btn-print'), - action : 'print', - caption : this.btnPrintCaption, - canFocused: false, - dataHint: 1, - dataHintDirection: 'left-top', - dataHintOffset: [2, 14] - }); - this.miPrintWithPreview = new Common.UI.MenuItem({ el : $markup.elementById('#fm-btn-print-with-preview'), - action : 'print-with-preview', + action : 'printpreview', caption : this.btnPrintCaption, canFocused: false, dataHint: 1, @@ -253,7 +243,6 @@ define([ this.miDownload, this.miSaveCopyAs, this.miSaveAs, - this.miPrint, this.miPrintWithPreview, this.miRename, this.miProtect, @@ -353,7 +342,6 @@ define([ this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); this.miSave[this.mode.isEdit?'show':'hide'](); this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); - this.miPrint[this.mode.canPrint?'show':'hide'](); this.miPrintWithPreview[this.mode.canPrint?'show':'hide'](); this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); this.miProtect[this.mode.canProtect ?'show':'hide'](); @@ -422,7 +410,7 @@ define([ if (this.mode.canPrint) { var printPanel = SSE.getController('Print').getView('PrintWithPreview'); printPanel.menu = this; - this.panels['print-with-preview'] = printPanel.render(this.$el.find('#panel-print')); + this.panels['printpreview'] = printPanel.render(this.$el.find('#panel-print')); } },