[DE PE] refactoring
This commit is contained in:
parent
6d385730b1
commit
cb82ea8230
|
@ -1543,9 +1543,7 @@ define([
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
},
|
},
|
||||||
onDocumentCanSaveChanged: function (isCanSave) {
|
onDocumentCanSaveChanged: function (isCanSave) {
|
||||||
var application = this.getApplication(),
|
var toolbarView = this.getApplication().getController('Toolbar').getView();
|
||||||
toolbarController = application.getController('Toolbar'),
|
|
||||||
toolbarView = toolbarController.getView();
|
|
||||||
|
|
||||||
if (toolbarView && this.api && !toolbarView._state.previewmode) {
|
if (toolbarView && this.api && !toolbarView._state.previewmode) {
|
||||||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||||
|
|
|
@ -2762,7 +2762,7 @@ define([
|
||||||
// hide 'print' and 'save' buttons group and next separator
|
// hide 'print' and 'save' buttons group and next separator
|
||||||
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
|
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
|
||||||
|
|
||||||
// hide 'undo' and 'redo' buttons and get container
|
// hide 'undo' and 'redo' buttons and retrieve parent container
|
||||||
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
|
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
|
||||||
|
|
||||||
// move 'paste' button to the container instead of 'undo' and 'redo'
|
// move 'paste' button to the container instead of 'undo' and 'redo'
|
||||||
|
|
|
@ -409,8 +409,7 @@ define([
|
||||||
|
|
||||||
onEditComplete: function(cmp) {
|
onEditComplete: function(cmp) {
|
||||||
var application = this.getApplication(),
|
var application = this.getApplication(),
|
||||||
toolbarController = application.getController('Toolbar'),
|
toolbarView = application.getController('Toolbar').getView('Toolbar');
|
||||||
toolbarView = toolbarController.getView('Toolbar');
|
|
||||||
|
|
||||||
application.getController('DocumentHolder').getView('DocumentHolder').focus();
|
application.getController('DocumentHolder').getView('DocumentHolder').focus();
|
||||||
if (this.api && this.api.asc_isDocumentCanSave) {
|
if (this.api && this.api.asc_isDocumentCanSave) {
|
||||||
|
@ -1281,10 +1280,8 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onDocumentCanSaveChanged: function (isCanSave) {
|
onDocumentCanSaveChanged: function (isCanSave) {
|
||||||
var application = this.getApplication(),
|
var toolbarView = this.getApplication().getController('Toolbar').getView('Toolbar');
|
||||||
toolbarController = application.getController('Toolbar'),
|
if ( toolbarView ) {
|
||||||
toolbarView = toolbarController.getView('Toolbar');
|
|
||||||
if (toolbarView) {
|
|
||||||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||||
forcesave = this.appOptions.forcesave,
|
forcesave = this.appOptions.forcesave,
|
||||||
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||||
|
|
Loading…
Reference in a new issue