redefine 'save' button for desktop app

This commit is contained in:
Maxim Kadushkin 2018-02-28 16:22:14 +03:00
parent 6cf3ee7fb9
commit 8a9c221eb3
3 changed files with 11 additions and 1 deletions

View file

@ -163,6 +163,9 @@ define([
_intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls'));
$filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height'));
toolbar = me.getApplication().getController('Toolbar').getView();
toolbar.btnCollabChanges = me.header.btnSave;
}
},

View file

@ -100,7 +100,6 @@ define([
'save:disabled' : function (state) {
if ( me.header.btnSave )
me.header.btnSave.setDisabled(state);
console.log('header save: ' + state);
}
},
// Events generated by main view
@ -167,6 +166,9 @@ define([
_intvars.set('toolbar-height-normal', _tabs_new_height + _intvars.get('toolbar-height-controls'));
$filemenu.css('top', _tabs_new_height + _intvars.get('document-title-height'));
toolbar = me.getApplication().getController('Toolbar').getView('Toolbar');
toolbar.btnCollabChanges = me.header.btnSave;
}
},

View file

@ -76,6 +76,11 @@ define([
var config = SSE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config));
toolbar.setExtra('left', me.header.getPanel('left', config));
if ( me.appConfig && me.appConfig.isDesktopApp &&
me.appConfig.isEdit && toolbar.btnCollabChanges )
toolbar.btnCollabChanges = me.header.btnSave;
},
'view:compact' : function (toolbar, state) {
me.viewport.vlayout.getItem('toolbar').height = state ?