[DE mobile] Disable toolbar buttons if object is locked.
This commit is contained in:
parent
ec64c39a4a
commit
0ee22bffc4
|
@ -204,8 +204,7 @@ define([
|
|||
});
|
||||
|
||||
if (stack.length > 0) {
|
||||
var topObject = stack[stack.length - 1],
|
||||
topObjectType = topObject.get_ObjectType(),
|
||||
var topObject = _.find(stack.reverse(), function(obj){ return obj.get_ObjectType() != Asc.c_oAscTypeSelectElement.SpellCheck; }),
|
||||
topObjectValue = topObject.get_ObjectValue(),
|
||||
objectLocked = _.isFunction(topObjectValue.get_Locked) ? topObjectValue.get_Locked() : false;
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ define([
|
|||
|
||||
this.api.asc_registerCallback('asc_onCanUndo', _.bind(this.onApiCanRevert, this, 'undo'));
|
||||
this.api.asc_registerCallback('asc_onCanRedo', _.bind(this.onApiCanRevert, this, 'redo'));
|
||||
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this));
|
||||
},
|
||||
|
||||
setMode: function (mode) {
|
||||
|
@ -144,6 +145,18 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onApiFocusObject: function (objects) {
|
||||
if (objects.length > 0) {
|
||||
var topObject = _.find(objects.reverse(), function (obj) {
|
||||
return obj.get_ObjectType() != Asc.c_oAscTypeSelectElement.SpellCheck;
|
||||
}),
|
||||
topObjectValue = topObject.get_ObjectValue(),
|
||||
objectLocked = _.isFunction(topObjectValue.get_Locked) ? topObjectValue.get_Locked() : false;
|
||||
|
||||
$('#toolbar-add, #toolbar-edit').toggleClass('disabled', objectLocked);
|
||||
}
|
||||
},
|
||||
|
||||
dlgLeaveTitleText : 'You leave the application',
|
||||
dlgLeaveMsgText : 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
|
||||
leaveButtonText : 'Leave this Page',
|
||||
|
|
Loading…
Reference in a new issue