diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 8fe823ca4..f2f61caad 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -678,10 +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)); - if(this.initConfig.automove){ - this.binding.windowresize = _.bind(_onResizeMove, this); - $(window).on('resize', this.binding.windowresize); - } if (!this.initConfig.modal) Common.Gateway.on('processmouse', _.bind(_onProcessMouse, this)); } else { @@ -765,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; @@ -862,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/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]}); }