diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 97ccdeb4a..7791cc9f3 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -483,7 +483,7 @@ define([ me.setUserName(me.options.userName); if ( config.canPrint && config.isEdit ) { - me.btnPrint = createTitleButton('svg-btn-print', $('#slot-btn-dt-print', $html)); + me.btnPrint = createTitleButton('svg-btn-print', $('#slot-btn-dt-print', $html), true); } me.btnSave = createTitleButton('svg-btn-save', $('#slot-btn-dt-save', $html), true); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index f062fd10a..87de2d975 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -238,6 +238,7 @@ define([ */ toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); + toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled')); diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 852d9fc01..37c506702 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -96,6 +96,10 @@ define([ me.header.btnRedo.keepState.disabled = state; else me.header.btnRedo.setDisabled(state); }, + 'print:disabled' : function (state) { + if ( me.header.btnPrint ) + me.header.btnPrint.setDisabled(state); + }, 'save:disabled' : function (state) { if ( me.header.btnSave ) me.header.btnSave.setDisabled(state); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 4293a236c..b20747e6f 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -124,7 +124,8 @@ define([ this.btnPrint = new Common.UI.Button({ id: 'id-toolbar-btn-print', cls: 'btn-toolbar', - iconCls: 'btn-print no-mask' + iconCls: 'btn-print no-mask', + signals: ['disabled'] }); this.toolbarControls.push(this.btnPrint); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 28366bef8..09f5f7102 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -255,6 +255,7 @@ define([ toolbar.btnPreview.on('click', _.bind(this.onPreviewBtnClick, this)); toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this)); toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); + toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled')); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); diff --git a/apps/presentationeditor/main/app/controller/Viewport.js b/apps/presentationeditor/main/app/controller/Viewport.js index 52f111403..39052d19b 100644 --- a/apps/presentationeditor/main/app/controller/Viewport.js +++ b/apps/presentationeditor/main/app/controller/Viewport.js @@ -98,6 +98,10 @@ define([ else me.header.btnRedo.setDisabled(state); } }, + 'print:disabled' : function (state) { + if ( me.header.btnPrint ) + me.header.btnPrint.setDisabled(state); + }, 'save:disabled' : function (state) { if ( me.header.btnSave ) me.header.btnSave.setDisabled(state); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 90149a29f..53e153621 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -175,7 +175,8 @@ define([ id: 'id-toolbar-btn-print', cls: 'btn-toolbar', iconCls: 'btn-print no-mask', - lock: [_set.slideDeleted, _set.noSlides, _set.cantPrint, _set.disableOnStart] + lock: [_set.slideDeleted, _set.noSlides, _set.cantPrint, _set.disableOnStart], + signals: ['disabled'] }); me.slideOnlyControls.push(me.btnPrint); @@ -1287,9 +1288,6 @@ define([ me.mnuChangeSlidePicker._needRecalcSlideLayout = true; }); -// // Enable none paragraph components - this.lockToolbar(PE.enumLock.disableOnStart, false, {array: this.slideOnlyControls.concat(this.shapeControls)}); - /** coauthoring begin **/ this.showSynchTip = !Common.localStorage.getBool('pe-hide-synch'); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index cbacefdaf..4607ef9f2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -257,6 +257,7 @@ define([ toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this)); } else { toolbar.btnPrint.on('click', _.bind(this.onPrint, this)); + toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled')); toolbar.btnSave.on('click', _.bind(this.onSave, this)); toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled')); toolbar.btnUndo.on('click', _.bind(this.onUndo, this)); @@ -2972,6 +2973,7 @@ define([ me.toolbar.btnSave && me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled')); me.toolbar.btnUndo && me.toolbar.btnUndo.on('disabled', _.bind(me.onBtnChangeState, me, 'undo:disabled')); me.toolbar.btnRedo && me.toolbar.btnRedo.on('disabled', _.bind(me.onBtnChangeState, me, 'redo:disabled')); + me.toolbar.btnPrint && me.toolbar.btnPrint.on('disabled', _.bind(me.onBtnChangeState, me, 'print:disabled')); me.toolbar.setApi(me.api); if ( !config.isEditDiagram && !config.isEditMailMerge ) { diff --git a/apps/spreadsheeteditor/main/app/controller/Viewport.js b/apps/spreadsheeteditor/main/app/controller/Viewport.js index c7fba719a..c44578826 100644 --- a/apps/spreadsheeteditor/main/app/controller/Viewport.js +++ b/apps/spreadsheeteditor/main/app/controller/Viewport.js @@ -104,6 +104,10 @@ define([ else me.header.btnRedo.setDisabled(state); } }, + 'print:disabled' : function (state) { + if ( me.header.btnPrint ) + me.header.btnPrint.setDisabled(state); + }, 'save:disabled' : function (state) { if ( me.header.btnSave ) me.header.btnSave.setDisabled(state); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index d846c71c0..6ec928803 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -381,7 +381,8 @@ define([ id : 'id-toolbar-btn-print', cls : 'btn-toolbar', iconCls : 'btn-print no-mask', - lock : [_set.editCell, _set.cantPrint, _set.disableOnStart] + lock : [_set.editCell, _set.cantPrint, _set.disableOnStart], + signals: ['disabled'] }); me.btnSave = new Common.UI.Button({