diff --git a/apps/common/main/lib/controller/Protection.js b/apps/common/main/lib/controller/Protection.js
index 0bde39832..99e8ac821 100644
--- a/apps/common/main/lib/controller/Protection.js
+++ b/apps/common/main/lib/controller/Protection.js
@@ -74,7 +74,7 @@ define([
this._state = {};
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
- Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
setConfig: function (data, api) {
this.setApi(api);
@@ -96,7 +96,7 @@ define([
this.api.asc_registerCallback('asc_onUpdateSignatures', _.bind(this.onApiUpdateSignatures, this));
}
}
- this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.SetDisabled, this));
+ this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
}
},
@@ -114,8 +114,8 @@ define([
this.view && this.view.onDocumentPassword(hasPassword);
},
- SetDisabled: function(state) {
- this.view && this.view.SetDisabled(state);
+ SetDisabled: function(state, canProtect) {
+ this.view && this.view.SetDisabled(state, canProtect);
},
onPasswordClick: function(btn, opts){
@@ -148,9 +148,6 @@ define([
},
onAppReady: function (config) {
- var me = this;
- // this.onApiUpdateSignatures([{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}], [{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}]);
- // this.onDocumentPassword(true);
},
addPassword: function() {
@@ -244,7 +241,11 @@ define([
},
onApiUpdateSignatures: function(valid, requested){
- this.SetDisabled(valid && valid.length>0);
+ this.SetDisabled(valid && valid.length>0, true);// can add invisible signature
+ },
+
+ onCoAuthoringDisconnect: function() {
+ this.SetDisabled(true);
}
}, Common.Controllers.Protection || {}));
diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js
index bbd021515..d7188a89b 100644
--- a/apps/common/main/lib/controller/ReviewChanges.js
+++ b/apps/common/main/lib/controller/ReviewChanges.js
@@ -94,7 +94,7 @@ define([
Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this));
Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this));
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
- Common.NotificationCenter.on('api:disconnect', _.bind(this.SetDisabled, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
},
setConfig: function (data, api) {
this.setApi(api);
@@ -111,7 +111,7 @@ define([
this.api.asc_registerCallback('asc_onShowRevisionsChange', _.bind(this.onApiShowChange, this));
this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this));
}
- this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.SetDisabled, this));
+ this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
}
},
@@ -626,6 +626,10 @@ define([
})).show();
},
+ onCoAuthoringDisconnect: function() {
+ this.SetDisabled(true);
+ },
+
textInserted: 'Inserted:',
textDeleted: 'Deleted:',
textParaInserted: 'Paragraph Inserted ',
diff --git a/apps/common/main/lib/view/Protection.js b/apps/common/main/lib/view/Protection.js
index f7859644d..16f55fb20 100644
--- a/apps/common/main/lib/view/Protection.js
+++ b/apps/common/main/lib/view/Protection.js
@@ -189,7 +189,8 @@ define([
},
{
caption: me.txtSignatureLine,
- value: 'visible'
+ value: 'visible',
+ disabled: me._state.disabled
}
]
})
@@ -265,14 +266,17 @@ define([
}
},
- SetDisabled: function (state) {
+ SetDisabled: function (state, canProtect) {
this._state.disabled = state;
this.btnsInvisibleSignature && this.btnsInvisibleSignature.forEach(function(button) {
if ( button ) {
- button.setDisabled(state);
+ button.setDisabled(state && !canProtect);
}
}, this);
- this.btnSignature && this.btnSignature.setDisabled(state);
+ if (this.btnSignature && this.btnSignature.menu) {
+ this.btnSignature.menu.items && this.btnSignature.menu.items[1].setDisabled(state); // disable adding signature line
+ this.btnSignature.setDisabled(state && !canProtect); // disable adding any signature
+ }
this.btnsAddPwd.concat(this.btnsDelPwd, this.btnsChangePwd).forEach(function(button) {
if ( button ) {
button.setDisabled(state);
diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js
index 0019a658e..e8f72db52 100644
--- a/apps/documenteditor/main/app/controller/RightMenu.js
+++ b/apps/documenteditor/main/app/controller/RightMenu.js
@@ -281,9 +281,6 @@ define([
this.onFocusObject(selectedElements, !Common.localStorage.getBool("de-hide-right-settings"));
}
}
-
- //remove after sdk send event
- // this.onApiUpdateSignatures([{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}]);
},
onDoubleClickOnObject: function(obj) {
diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js
index c65425414..6b7c8e5d2 100644
--- a/apps/presentationeditor/main/app/controller/RightMenu.js
+++ b/apps/presentationeditor/main/app/controller/RightMenu.js
@@ -289,8 +289,6 @@ define([
this.onFocusObject(selectedElements, !Common.localStorage.getBool("pe-hide-right-settings"));
}
}
- //remove after sdk send event
- // this.onApiUpdateSignatures([{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}]);
},
onDoubleClickOnObject: function(obj) {
diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js
index 743acb127..ef5aa9818 100644
--- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js
+++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js
@@ -291,9 +291,6 @@ define([
this.rightmenu.shapeSettings.createDelayedElements();
this.onSelectionChanged(this.api.asc_getCellInfo());
}
-
- //remove after sdk send event
- // this.onApiUpdateSignatures([{name: 'Hammish Mitchell', guid: '123', date: '18/05/2017'}, {name: 'Someone Somewhere', guid: '345', date: '18/05/2017'}]);
},
onDoubleClickOnObject: function(obj) {