[SSE] Disable inserting sparklines when objects are selected (shape, image, chart).
This commit is contained in:
parent
1ed82bd37a
commit
14c2a177de
|
@ -101,7 +101,8 @@ define([
|
|||
id: Common.UI.getId(),
|
||||
selected: false,
|
||||
allowSelected: true,
|
||||
value: null
|
||||
value: null,
|
||||
disabled: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -142,6 +143,7 @@ define([
|
|||
el.off('click').on('click', _.bind(this.onClick, this));
|
||||
el.off('dblclick').on('dblclick', _.bind(this.onDblClick, this));
|
||||
el.off('contextmenu').on('contextmenu', _.bind(this.onContextMenu, this));
|
||||
el.toggleClass('disabled', this.model.get('disabled'));
|
||||
|
||||
if (!_.isUndefined(this.model.get('cls')))
|
||||
el.addClass(this.model.get('cls'));
|
||||
|
@ -159,10 +161,14 @@ define([
|
|||
},
|
||||
|
||||
onClick: function(e) {
|
||||
if (this.model.get('disabled')) return false;
|
||||
|
||||
this.trigger('click', this, this.model, e);
|
||||
},
|
||||
|
||||
onDblClick: function(e) {
|
||||
if (this.model.get('disabled')) return false;
|
||||
|
||||
this.trigger('dblclick', this, this.model, e);
|
||||
},
|
||||
|
||||
|
|
|
@ -46,12 +46,19 @@
|
|||
display: inline-block;
|
||||
float: left;
|
||||
margin: 2px 4px 4px;
|
||||
cursor: pointer;
|
||||
|
||||
&:not(.disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.box-shadow(0 0 0 1px @gray);
|
||||
|
||||
&:hover,
|
||||
&.selected {
|
||||
&:hover:not(.disabled),
|
||||
&.selected:not(.disabled) {
|
||||
.box-shadow(0 0 0 2px @primary);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,8 @@ define([
|
|||
tablename: undefined,
|
||||
namedrange_locked: false,
|
||||
fontsize: undefined,
|
||||
multiselect: false
|
||||
multiselect: false,
|
||||
sparklines_disabled: false
|
||||
};
|
||||
|
||||
var checkInsertAutoshape = function(e, action) {
|
||||
|
@ -1625,6 +1626,16 @@ define([
|
|||
|
||||
toolbar.lockToolbar(SSE.enumLock.cantHyperlink, (selectionType == Asc.c_oAscSelectionType.RangeShapeText) && (this.api.asc_canAddShapeHyperlink()===false), { array: [toolbar.btnInsertHyperlink]});
|
||||
|
||||
need_disable = selectionType != Asc.c_oAscSelectionType.RangeCells && selectionType != Asc.c_oAscSelectionType.RangeCol &&
|
||||
selectionType != Asc.c_oAscSelectionType.RangeRow && selectionType != Asc.c_oAscSelectionType.RangeMax;
|
||||
if (this._state.sparklines_disabled !== need_disable) {
|
||||
var len = toolbar.mnuInsertChartPicker.store.length;
|
||||
for (var i=0; i<3; i++) {
|
||||
toolbar.mnuInsertChartPicker.store.at(len-i-1).set({disabled: need_disable});
|
||||
this._state.sparklines_disabled = need_disable;
|
||||
}
|
||||
}
|
||||
|
||||
if (editOptionsDisabled) return;
|
||||
|
||||
/* read font params */
|
||||
|
|
Loading…
Reference in a new issue