[DE] Fix bug 33051

This commit is contained in:
Alexander Yuzhin 2016-09-16 14:49:01 +03:00
parent e7589a5f3e
commit bf566734ee
2 changed files with 9 additions and 1 deletions

View file

@ -209,6 +209,7 @@ Ext.define('DE.controller.Main', {
onLongActionEnd: function(type) {
Ext.Viewport.unmask();
Common.Gateway.setDocumentModified(this.api.isDocumentModified());
},
onError: function(id, level, errData) {

View file

@ -166,6 +166,7 @@ Ext.define('DE.controller.toolbar.Edit', {
this.api.asc_registerCallback('asc_onCanUndo', Ext.bind(this.onApiCanUndo, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', Ext.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onDocumentModifiedChanged', Ext.bind(this.onApiDocumentModified, this));
this.api.asc_registerCallback('asc_onDocumentCanSaveChanged', Ext.bind(this.onApiDocumentCanSaveChanged, this));
}
},
@ -199,7 +200,7 @@ Ext.define('DE.controller.toolbar.Edit', {
},
onApiDocumentModified: function() {
var isModified = this.api.isDocumentModified();
var isModified = this.api.asc_isDocumentCanSave();
if (this.isDocModified !== isModified) {
if (this.getSaveButton()) {
this.getSaveButton().setDisabled(!isModified);
@ -210,6 +211,12 @@ Ext.define('DE.controller.toolbar.Edit', {
}
},
onApiDocumentCanSaveChanged: function (isCanSave) {
if (this.getSaveButton()) {
this.getSaveButton().setDisabled(!isCanSave);
}
},
showToolbarPanel: function(panel, button){
if (panel && button){
panel.on('hide', Ext.bind(function(){