Update Desktop.js (#349)
This commit is contained in:
parent
257b3509d8
commit
ca46cf41b0
|
@ -193,24 +193,31 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
||||||
titlebuttons = {
|
titlebuttons = {};
|
||||||
'save': {btn: header.btnSave, disabled:false},
|
if ( !!header.btnSave ) {
|
||||||
'print': {btn: header.btnPrint, disabled:false},
|
titlebuttons['save'] = {btn: header.btnSave, disabled:false};
|
||||||
'undo': {btn: header.btnUndo, disabled:false},
|
|
||||||
'redo': {btn: header.btnRedo, disabled:false}
|
header.btnSave.options.signals.push('icon:changed');
|
||||||
};
|
header.btnSave.on('icon:changed', _onSaveIconChanged.bind(this));
|
||||||
|
|
||||||
|
var iconname = /\s?([^\s]+)$/.exec(titlebuttons.save.btn.$icon.attr('class'));
|
||||||
|
!!iconname && iconname.length && (titlebuttons.save.icon = btnsave_icons[iconname]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !!header.btnPrint )
|
||||||
|
titlebuttons['print'] = {btn: header.btnPrint, disabled:false};
|
||||||
|
|
||||||
|
if ( !!header.btnUndo )
|
||||||
|
titlebuttons['undo'] = {btn: header.btnUndo, disabled:false};
|
||||||
|
|
||||||
|
if ( !!header.btnRedo )
|
||||||
|
titlebuttons['redo'] = {btn: header.btnRedo, disabled:false};
|
||||||
|
|
||||||
for (var i in titlebuttons) {
|
for (var i in titlebuttons) {
|
||||||
titlebuttons[i].btn.options.signals = ['disabled'];
|
titlebuttons[i].btn.options.signals = ['disabled'];
|
||||||
titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i));
|
titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
header.btnSave.options.signals.push('icon:changed');
|
|
||||||
header.btnSave.on('icon:changed', _onSaveIconChanged.bind(this));
|
|
||||||
|
|
||||||
var iconname = /\s?([^\s]+)$/.exec(titlebuttons.save.btn.$icon.attr('class'));
|
|
||||||
!!iconname && iconname.length && (titlebuttons.save.icon = btnsave_icons[iconname]);
|
|
||||||
|
|
||||||
if ( !!config.callback_editorconfig ) {
|
if ( !!config.callback_editorconfig ) {
|
||||||
config.callback_editorconfig();
|
config.callback_editorconfig();
|
||||||
delete config.callback_editorconfig;
|
delete config.callback_editorconfig;
|
||||||
|
|
Loading…
Reference in a new issue