diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 717d5a325..b72806304 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2509,7 +2509,8 @@ define([ this.getApplication().getController('RightMenu').updateMetricUnit(); this.getApplication().getController('Toolbar').getView('Toolbar').updateMetricUnit(); } - this.getApplication().getController('Print').getView('MainSettingsPrint').updateMetricUnit(); + //this.getApplication().getController('Print').getView('MainSettingsPrint').updateMetricUnit(); + this.getApplication().getController('Print').getView('PrintWithPreview').updateMetricUnit(); }, _compareActionStrong: function(obj1, obj2){ diff --git a/apps/spreadsheeteditor/main/app/controller/Print.js b/apps/spreadsheeteditor/main/app/controller/Print.js index 6f22a4959..8bdb5e4bf 100644 --- a/apps/spreadsheeteditor/main/app/controller/Print.js +++ b/apps/spreadsheeteditor/main/app/controller/Print.js @@ -39,7 +39,8 @@ define([ SSE.Controllers.Print = Backbone.Controller.extend(_.extend({ views: [ - 'MainSettingsPrint' + 'MainSettingsPrint', + 'PrintWithPreview' ], initialize: function() { @@ -53,7 +54,11 @@ define([ this._originalPageSettings = null; this.addListeners({ - 'MainSettingsPrint': { + /*'MainSettingsPrint': { + 'show': _.bind(this.onShowMainSettingsPrint, this), + 'render:after': _.bind(this.onAfterRender, this) + },*/ + 'PrintWithPreview': { 'show': _.bind(this.onShowMainSettingsPrint, this), 'render:after': _.bind(this.onAfterRender, this) }, @@ -66,12 +71,13 @@ define([ }, onLaunch: function() { - this.printSettings = this.createView('MainSettingsPrint'); + //this.printSettings = this.createView('MainSettingsPrint'); + this.printSettings = this.createView('PrintWithPreview'); }, onAfterRender: function(view) { this.printSettings.cmbSheet.on('selected', _.bind(this.comboSheetsChange, this, this.printSettings)); - this.printSettings.btnOk.on('click', _.bind(this.querySavePrintSettings, this)); + this.printSettings.btnSave.on('click', _.bind(this.querySavePrintSettings, this)); this.fillComponents(this.printSettings); this.registerControlEvents(this.printSettings); }, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 3352738ae..8e5b5f6d8 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -420,7 +420,9 @@ define([ } if (this.mode.canPrint) { - this.panels['print-with-preview'] = ((new SSE.Views.FileMenuPanels.PrintWithPreview({menu:this})).render(this.$el.find('#panel-print'))); + var printPanel = SSE.getController('Print').getView('PrintWithPreview'); + printPanel.menu = this; + this.panels['print-with-preview'] = printPanel.render(this.$el.find('#panel-print')); } }, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index a82071b93..0754efbe4 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -210,9 +210,9 @@ define([ this.generalSettings.options = {alias:'MainSettingsGeneral'}; this.generalSettings.render($markup.findById('#panel-settings-general')); - this.printSettings = SSE.getController('Print').getView('MainSettingsPrint'); - this.printSettings.menu = this.menu; - this.printSettings.render($markup.findById('#panel-settings-print')); + //this.printSettings = SSE.getController('Print').getView('MainSettingsPrint'); + //this.printSettings.menu = this.menu; + //this.printSettings.render($markup.findById('#panel-settings-print')); this.spellcheckSettings = new SSE.Views.FileMenuPanels.MainSpellCheckSettings({menu: this.menu}); this.spellcheckSettings.render($markup.findById('#panel-settings-spellcheck')); @@ -221,7 +221,7 @@ define([ el: $markup.findById('#id-settings-menu'), store: new Common.UI.DataViewStore([ {name: this.txtGeneral, panel: this.generalSettings, iconCls:'toolbar__icon btn-settings', contentTarget: 'panel-settings-general', selected: true}, - {name: this.txtPageSettings, panel: this.printSettings, iconCls:'toolbar__icon btn-print', contentTarget: 'panel-settings-print'}, + //{name: this.txtPageSettings, panel: this.printSettings, iconCls:'toolbar__icon btn-print', contentTarget: 'panel-settings-print'}, {name: this.txtSpellChecking, panel: this.spellcheckSettings, iconCls:'toolbar__icon btn-ic-docspell', contentTarget: 'panel-settings-spellcheck'} ]), itemTemplate: _.template([ @@ -2678,7 +2678,7 @@ define([ }, SSE.Views.FileMenuPanels.ProtectDoc || {})); - SSE.Views.FileMenuPanels.PrintWithPreview = Common.UI.BaseView.extend(_.extend({ + SSE.Views.PrintWithPreview = Common.UI.BaseView.extend(_.extend({ el: '#panel-print', menu: undefined, @@ -2746,7 +2746,7 @@ define([ '