Hide styles for combined charts
This commit is contained in:
parent
e83357f86a
commit
c5a4982382
|
@ -42,7 +42,7 @@
|
|||
<div id="chart-button-type" style=""></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="not-combined">
|
||||
<td class="padding-small" colspan=2>
|
||||
<div class="" id="chart-combo-style" style="width: 100%;"></div>
|
||||
</td>
|
||||
|
|
|
@ -94,6 +94,7 @@ define([
|
|||
|
||||
this.labelWidth = el.find('#chart-label-width');
|
||||
this.labelHeight = el.find('#chart-label-height');
|
||||
this.NotCombinedSettings = $('.not-combined');
|
||||
},
|
||||
|
||||
setApi: function(api) {
|
||||
|
@ -147,11 +148,15 @@ define([
|
|||
this.btnChartType.setIconCls('svgicon ' + 'chart-' + record.get('iconCls'));
|
||||
} else
|
||||
this.btnChartType.setIconCls('svgicon');
|
||||
this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
this.ShowCombinedProps(type);
|
||||
!(type===null || type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom) && this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
this._state.ChartType = type;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom)) {
|
||||
value = props.get_SeveralChartStyles();
|
||||
if (this._state.SeveralCharts && value) {
|
||||
this.cmbChartStyle.fieldPicker.deselectAll();
|
||||
|
@ -159,7 +164,7 @@ define([
|
|||
this._state.ChartStyle = null;
|
||||
} else {
|
||||
value = this.chartProps.getStyle();
|
||||
if (this._state.ChartStyle!==value || this._isChartStylesChanged) {
|
||||
if (this._state.ChartStyle !== value || this._isChartStylesChanged) {
|
||||
this.cmbChartStyle.suspendEvents();
|
||||
var rec = this.cmbChartStyle.menuPicker.store.findWhere({data: value});
|
||||
this.cmbChartStyle.menuPicker.selectRecord(rec);
|
||||
|
@ -167,14 +172,15 @@ define([
|
|||
|
||||
if (this._isChartStylesChanged) {
|
||||
if (rec)
|
||||
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true);
|
||||
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(), true);
|
||||
else
|
||||
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
|
||||
}
|
||||
this._state.ChartStyle=value;
|
||||
this._state.ChartStyle = value;
|
||||
}
|
||||
}
|
||||
this._isChartStylesChanged = false;
|
||||
}
|
||||
|
||||
this._noApply = false;
|
||||
|
||||
|
@ -414,7 +420,9 @@ define([
|
|||
},
|
||||
|
||||
_onUpdateChartStyles: function() {
|
||||
if (this.api && this._state.ChartType!==null && this._state.ChartType>-1)
|
||||
if (this.api && this._state.ChartType!==null && this._state.ChartType>-1 &&
|
||||
!(this._state.ChartType==Asc.c_oAscChartTypeSettings.comboBarLine || this._state.ChartType==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
this._state.ChartType==Asc.c_oAscChartTypeSettings.comboAreaBar || this._state.ChartType==Asc.c_oAscChartTypeSettings.comboCustom))
|
||||
this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType));
|
||||
},
|
||||
|
||||
|
@ -471,6 +479,11 @@ define([
|
|||
this.cmbChartStyle.setDisabled(!styles || styles.length<1 || this._locked);
|
||||
},
|
||||
|
||||
ShowCombinedProps: function(type) {
|
||||
this.NotCombinedSettings.toggleClass('settings-hidden', type===null || type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom);
|
||||
},
|
||||
|
||||
setLocked: function (locked) {
|
||||
this._locked = locked;
|
||||
},
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<div id="chart-button-type" style=""></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="not-combined">
|
||||
<td class="padding-small">
|
||||
<div id="chart-combo-style" style=""></div>
|
||||
</td>
|
||||
|
|
|
@ -131,11 +131,15 @@ define([
|
|||
this.btnChartType.setIconCls('svgicon ' + 'chart-' + record.get('iconCls'));
|
||||
} else
|
||||
this.btnChartType.setIconCls('svgicon');
|
||||
this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
this.ShowCombinedProps(type);
|
||||
!(type===null || type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom) && this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
this._state.ChartType = type;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom)) {
|
||||
value = props.get_SeveralChartStyles();
|
||||
if (this._state.SeveralCharts && value) {
|
||||
this.cmbChartStyle.fieldPicker.deselectAll();
|
||||
|
@ -143,7 +147,7 @@ define([
|
|||
this._state.ChartStyle = null;
|
||||
} else {
|
||||
value = props.getStyle();
|
||||
if (this._state.ChartStyle!==value || this._isChartStylesChanged) {
|
||||
if (this._state.ChartStyle !== value || this._isChartStylesChanged) {
|
||||
this.cmbChartStyle.suspendEvents();
|
||||
var rec = this.cmbChartStyle.menuPicker.store.findWhere({data: value});
|
||||
this.cmbChartStyle.menuPicker.selectRecord(rec);
|
||||
|
@ -151,14 +155,15 @@ define([
|
|||
|
||||
if (this._isChartStylesChanged) {
|
||||
if (rec)
|
||||
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true);
|
||||
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(), true);
|
||||
else
|
||||
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
|
||||
}
|
||||
this._state.ChartStyle=value;
|
||||
this._state.ChartStyle = value;
|
||||
}
|
||||
}
|
||||
this._isChartStylesChanged = false;
|
||||
}
|
||||
|
||||
this._noApply = false;
|
||||
|
||||
|
@ -285,6 +290,7 @@ define([
|
|||
this.linkAdvanced = $('#chart-advanced-link');
|
||||
$(this.el).on('click', '#chart-advanced-link', _.bind(this.openAdvancedSettings, this));
|
||||
|
||||
this.NotCombinedSettings = $('.not-combined');
|
||||
},
|
||||
|
||||
createDelayedElements: function() {
|
||||
|
@ -351,7 +357,9 @@ define([
|
|||
},
|
||||
|
||||
_onUpdateChartStyles: function() {
|
||||
if (this.api && this._state.ChartType!==null && this._state.ChartType>-1)
|
||||
if (this.api && this._state.ChartType!==null && this._state.ChartType>-1 &&
|
||||
!(this._state.ChartType==Asc.c_oAscChartTypeSettings.comboBarLine || this._state.ChartType==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
this._state.ChartType==Asc.c_oAscChartTypeSettings.comboAreaBar || this._state.ChartType==Asc.c_oAscChartTypeSettings.comboCustom))
|
||||
this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType));
|
||||
},
|
||||
|
||||
|
@ -479,6 +487,11 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
ShowCombinedProps: function(type) {
|
||||
this.NotCombinedSettings.toggleClass('settings-hidden', type===null || type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom);
|
||||
},
|
||||
|
||||
setLocked: function (locked) {
|
||||
this._locked = locked;
|
||||
},
|
||||
|
|
|
@ -156,10 +156,13 @@ define([
|
|||
var type = (this._state.SeveralCharts && value) ? null : this.chartProps.getType();
|
||||
if (this._state.ChartType !== type) {
|
||||
this.ShowCombinedProps(type);
|
||||
(type !== null) && this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
!(type===null || type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom) && this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
this._state.ChartType = type;
|
||||
}
|
||||
|
||||
if (!(type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom)) {
|
||||
value = props.asc_getSeveralChartStyles();
|
||||
if (this._state.SeveralCharts && value) {
|
||||
this.cmbChartStyle.fieldPicker.deselectAll();
|
||||
|
@ -183,6 +186,7 @@ define([
|
|||
}
|
||||
}
|
||||
this._isChartStylesChanged = false;
|
||||
}
|
||||
|
||||
this._noApply = false;
|
||||
|
||||
|
@ -954,7 +958,9 @@ define([
|
|||
},
|
||||
|
||||
_onUpdateChartStyles: function() {
|
||||
if (this.api && this._state.ChartType!==null && this._state.ChartType>-1)
|
||||
if (this.api && this._state.ChartType!==null && this._state.ChartType>-1 &&
|
||||
!(this._state.ChartType==Asc.c_oAscChartTypeSettings.comboBarLine || this._state.ChartType==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
|
||||
this._state.ChartType==Asc.c_oAscChartTypeSettings.comboAreaBar || this._state.ChartType==Asc.c_oAscChartTypeSettings.comboCustom))
|
||||
this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType));
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue