diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index ce8de1c2c..f2f61caad 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -158,7 +158,8 @@ define([ maxheight: undefined, minwidth: 0, minheight: 0, - enableKeyEvents: true + enableKeyEvents: true, + automove: true }; var template = '
<%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' + @@ -677,7 +678,6 @@ define([ this.$window.find('.header').on('mousedown', this.binding.dragStart); this.$window.find('.tool.close').on('click', _.bind(doclose, this)); this.$window.find('.tool.help').on('click', _.bind(dohelp, this)); - $(window).on('resize', _.bind(_onResizeMove, this)); if (!this.initConfig.modal) Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this)); } else { @@ -761,6 +761,10 @@ define([ } $(document).on('keydown.' + this.cid, this.binding.keydown); + if(this.initConfig.automove){ + this.binding.windowresize = _.bind(_onResizeMove, this); + $(window).on('resize', this.binding.windowresize); + } var me = this; @@ -812,6 +816,7 @@ define([ close: function(suppressevent) { $(document).off('keydown.' + this.cid); + this.initConfig.automove && $(window).off('resize', this.binding.windowresize); if ( this.initConfig.header ) { this.$window.find('.header').off('mousedown', this.binding.dragStart); } @@ -857,6 +862,7 @@ define([ hide: function() { $(document).off('keydown.' + this.cid); + this.initConfig.automove && $(window).off('resize', this.binding.windowresize); if (this.$window) { if (this.initConfig.modal) { var mask = _getMask(), diff --git a/apps/common/main/lib/view/PluginDlg.js b/apps/common/main/lib/view/PluginDlg.js index 12abd51b2..0c17537c9 100644 --- a/apps/common/main/lib/view/PluginDlg.js +++ b/apps/common/main/lib/view/PluginDlg.js @@ -54,7 +54,8 @@ define([ var _options = {}; _.extend(_options, { header: true, - enableKeyEvents: false + enableKeyEvents: false, + automove: false }, options); var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34; diff --git a/apps/common/main/lib/view/ReviewPopover.js b/apps/common/main/lib/view/ReviewPopover.js index 2d26dec68..d666bcab2 100644 --- a/apps/common/main/lib/view/ReviewPopover.js +++ b/apps/common/main/lib/view/ReviewPopover.js @@ -85,6 +85,7 @@ define([ height: 120, header: false, modal: false, + automove: false, alias: 'Common.Views.ReviewPopover' }, options); diff --git a/apps/common/main/lib/view/SearchBar.js b/apps/common/main/lib/view/SearchBar.js index 9437be55d..5f5346bd4 100644 --- a/apps/common/main/lib/view/SearchBar.js +++ b/apps/common/main/lib/view/SearchBar.js @@ -53,7 +53,8 @@ define([ cls: 'search-bar', alias: 'SearchBar', showOpenPanel: true, - toolclose: 'hide' + toolclose: 'hide', + automove: false }, initialize : function(options) { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 6de1eed28..e1b63fd7a 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2932,7 +2932,7 @@ define([ this.lockToolbar(Common.enumLock.cantPrint, true, {array: [this.btnPrint]}); } else { this.mode = mode; - !mode.canPrint && this.btnPrint.hide(); + !mode.canPrint && this.btnPrint && this.btnPrint.hide(); this.lockToolbar(Common.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]}); }