diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index ab2a3d5f5..398c84a8e 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -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) { diff --git a/apps/documenteditor/mobile/app/controller/toolbar/Edit.js b/apps/documenteditor/mobile/app/controller/toolbar/Edit.js index 50ea9a273..10c24b7c7 100644 --- a/apps/documenteditor/mobile/app/controller/toolbar/Edit.js +++ b/apps/documenteditor/mobile/app/controller/toolbar/Edit.js @@ -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(){