For Bug 38948: disable print button on start in the desktop header
This commit is contained in:
parent
3165fa2da9
commit
48fa05b250
|
@ -483,7 +483,7 @@ define([
|
||||||
me.setUserName(me.options.userName);
|
me.setUserName(me.options.userName);
|
||||||
|
|
||||||
if ( config.canPrint && config.isEdit ) {
|
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);
|
me.btnSave = createTitleButton('svg-btn-save', $('#slot-btn-dt-save', $html), true);
|
||||||
|
|
|
@ -238,6 +238,7 @@ define([
|
||||||
*/
|
*/
|
||||||
|
|
||||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, 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('click', _.bind(this.onSave, this));
|
||||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||||
toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
||||||
|
|
|
@ -96,6 +96,10 @@ define([
|
||||||
me.header.btnRedo.keepState.disabled = state;
|
me.header.btnRedo.keepState.disabled = state;
|
||||||
else me.header.btnRedo.setDisabled(state);
|
else me.header.btnRedo.setDisabled(state);
|
||||||
},
|
},
|
||||||
|
'print:disabled' : function (state) {
|
||||||
|
if ( me.header.btnPrint )
|
||||||
|
me.header.btnPrint.setDisabled(state);
|
||||||
|
},
|
||||||
'save:disabled' : function (state) {
|
'save:disabled' : function (state) {
|
||||||
if ( me.header.btnSave )
|
if ( me.header.btnSave )
|
||||||
me.header.btnSave.setDisabled(state);
|
me.header.btnSave.setDisabled(state);
|
||||||
|
|
|
@ -124,7 +124,8 @@ define([
|
||||||
this.btnPrint = new Common.UI.Button({
|
this.btnPrint = new Common.UI.Button({
|
||||||
id: 'id-toolbar-btn-print',
|
id: 'id-toolbar-btn-print',
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'btn-print no-mask'
|
iconCls: 'btn-print no-mask',
|
||||||
|
signals: ['disabled']
|
||||||
});
|
});
|
||||||
this.toolbarControls.push(this.btnPrint);
|
this.toolbarControls.push(this.btnPrint);
|
||||||
|
|
||||||
|
|
|
@ -255,6 +255,7 @@ define([
|
||||||
toolbar.btnPreview.on('click', _.bind(this.onPreviewBtnClick, this));
|
toolbar.btnPreview.on('click', _.bind(this.onPreviewBtnClick, this));
|
||||||
toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this));
|
toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this));
|
||||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, 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('click', _.bind(this.onSave, this));
|
||||||
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||||
|
|
|
@ -98,6 +98,10 @@ define([
|
||||||
else me.header.btnRedo.setDisabled(state);
|
else me.header.btnRedo.setDisabled(state);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'print:disabled' : function (state) {
|
||||||
|
if ( me.header.btnPrint )
|
||||||
|
me.header.btnPrint.setDisabled(state);
|
||||||
|
},
|
||||||
'save:disabled' : function (state) {
|
'save:disabled' : function (state) {
|
||||||
if ( me.header.btnSave )
|
if ( me.header.btnSave )
|
||||||
me.header.btnSave.setDisabled(state);
|
me.header.btnSave.setDisabled(state);
|
||||||
|
|
|
@ -175,7 +175,8 @@ define([
|
||||||
id: 'id-toolbar-btn-print',
|
id: 'id-toolbar-btn-print',
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'btn-print no-mask',
|
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);
|
me.slideOnlyControls.push(me.btnPrint);
|
||||||
|
|
||||||
|
@ -1287,9 +1288,6 @@ define([
|
||||||
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
|
me.mnuChangeSlidePicker._needRecalcSlideLayout = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
// // Enable none paragraph components
|
|
||||||
this.lockToolbar(PE.enumLock.disableOnStart, false, {array: this.slideOnlyControls.concat(this.shapeControls)});
|
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
this.showSynchTip = !Common.localStorage.getBool('pe-hide-synch');
|
this.showSynchTip = !Common.localStorage.getBool('pe-hide-synch');
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,7 @@ define([
|
||||||
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
|
toolbar.btnClearAutofilter.on('click', _.bind(this.onClearFilter, this));
|
||||||
} else {
|
} else {
|
||||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, 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('click', _.bind(this.onSave, this));
|
||||||
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
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.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.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.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);
|
me.toolbar.setApi(me.api);
|
||||||
|
|
||||||
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
|
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
|
||||||
|
|
|
@ -104,6 +104,10 @@ define([
|
||||||
else me.header.btnRedo.setDisabled(state);
|
else me.header.btnRedo.setDisabled(state);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'print:disabled' : function (state) {
|
||||||
|
if ( me.header.btnPrint )
|
||||||
|
me.header.btnPrint.setDisabled(state);
|
||||||
|
},
|
||||||
'save:disabled' : function (state) {
|
'save:disabled' : function (state) {
|
||||||
if ( me.header.btnSave )
|
if ( me.header.btnSave )
|
||||||
me.header.btnSave.setDisabled(state);
|
me.header.btnSave.setDisabled(state);
|
||||||
|
|
|
@ -381,7 +381,8 @@ define([
|
||||||
id : 'id-toolbar-btn-print',
|
id : 'id-toolbar-btn-print',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'btn-print no-mask',
|
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({
|
me.btnSave = new Common.UI.Button({
|
||||||
|
|
Loading…
Reference in a new issue