[SSE] Disable table settings when cell is edited
This commit is contained in:
parent
9dae42ae27
commit
b87a02f19d
|
@ -85,6 +85,7 @@ define([
|
||||||
};
|
};
|
||||||
this.lockedControls = [];
|
this.lockedControls = [];
|
||||||
this._locked = false;
|
this._locked = false;
|
||||||
|
this.isEditCell = false;
|
||||||
|
|
||||||
this._originalProps = null;
|
this._originalProps = null;
|
||||||
this._noApply = false;
|
this._noApply = false;
|
||||||
|
@ -177,6 +178,7 @@ define([
|
||||||
this.api = o;
|
this.api = o;
|
||||||
if (o) {
|
if (o) {
|
||||||
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
||||||
|
this.api.asc_registerCallback('asc_onEditCell', this.onApiEditCell.bind(this));
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
@ -510,14 +512,21 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onApiEditCell: function(state) {
|
||||||
|
this.isEditCell = (state != Asc.c_oAscCellEditorState.editEnd);
|
||||||
|
if ( state == Asc.c_oAscCellEditorState.editStart || state == Asc.c_oAscCellEditorState.editEnd)
|
||||||
|
this.disableControls(this._locked);
|
||||||
|
},
|
||||||
|
|
||||||
setLocked: function (locked) {
|
setLocked: function (locked) {
|
||||||
this._locked = locked;
|
this._locked = locked;
|
||||||
},
|
},
|
||||||
|
|
||||||
disableControls: function(disable) {
|
disableControls: function(disable) {
|
||||||
if (this._initSettings) return;
|
if (this._initSettings) return;
|
||||||
|
disable = disable || this.isEditCell;
|
||||||
|
|
||||||
if (this._state.DisabledControls!==disable) {
|
if (this._state.DisabledControls!==disable) {
|
||||||
this._state.DisabledControls = disable;
|
this._state.DisabledControls = disable;
|
||||||
_.each(this.lockedControls, function(item) {
|
_.each(this.lockedControls, function(item) {
|
||||||
|
|
Loading…
Reference in a new issue