[DE] Fix svg icon for chart type
This commit is contained in:
parent
a939187601
commit
fd5c8d5f79
|
@ -646,8 +646,14 @@ define([
|
|||
oldCls = this.iconCls;
|
||||
|
||||
this.iconCls = cls;
|
||||
btnIconEl.removeClass(oldCls);
|
||||
btnIconEl.addClass(cls || '');
|
||||
if (/svgicon/.test(this.iconCls)) {
|
||||
var icon = /svgicon\s(\S+)/.exec(this.iconCls);
|
||||
btnIconEl.find('use.zoom-int').attr('xlink:href', icon && icon.length>1 ? '#' + icon[1]: '');
|
||||
btnIconEl.find('use.zoom-grit').attr('xlink:href', icon && icon.length>1 ? '#' + icon[1] + '-150' : '');
|
||||
} else {
|
||||
btnIconEl.removeClass(oldCls);
|
||||
btnIconEl.addClass(cls || '');
|
||||
}
|
||||
},
|
||||
|
||||
changeIcon: function(opts) {
|
||||
|
|
|
@ -777,6 +777,12 @@
|
|||
position: relative;
|
||||
}
|
||||
|
||||
svg.icon {
|
||||
vertical-align: middle;
|
||||
width: 52px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
.over,
|
||||
&:active,
|
||||
|
|
|
@ -136,17 +136,17 @@ define([
|
|||
|
||||
value = props.get_SeveralChartTypes();
|
||||
if (this._state.SeveralCharts && value) {
|
||||
// this.btnChartType.setIconCls('');
|
||||
this.btnChartType.setIconCls('svgicon');
|
||||
this._state.ChartType = null;
|
||||
} else {
|
||||
var type = this.chartProps.getType();
|
||||
if (this._state.ChartType !== type) {
|
||||
var record = this.mnuChartTypePicker.store.findWhere({type: type});
|
||||
this.mnuChartTypePicker.selectRecord(record, true);
|
||||
// if (record) {
|
||||
// this.btnChartType.setIconCls('item-chartlist ' + record.get('iconCls'));
|
||||
// } else
|
||||
// this.btnChartType.setIconCls('');
|
||||
if (record) {
|
||||
this.btnChartType.setIconCls('svgicon ' + 'chart-' + record.get('iconCls'));
|
||||
} else
|
||||
this.btnChartType.setIconCls('svgicon');
|
||||
this.updateChartStyles(this.api.asc_getChartPreviews(type));
|
||||
this._state.ChartType = type;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ define([
|
|||
cls : 'btn-large-dataview',
|
||||
iconCls : 'svgicon chart-column-normal',
|
||||
menu : new Common.UI.Menu({
|
||||
style: 'width: 435px; padding-top: 12px;',
|
||||
style: 'width: 364px; padding-top: 12px;',
|
||||
items: [
|
||||
{ template: _.template('<div id="id-chart-menu-type" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
|
||||
]
|
||||
|
@ -386,7 +386,7 @@ define([
|
|||
rawData = record;
|
||||
}
|
||||
|
||||
// this.btnChartType.setIconCls('item-chartlist ' + rawData.iconCls);
|
||||
this.btnChartType.setIconCls('svgicon ' + 'chart-' + rawData.iconCls);
|
||||
this._state.ChartType = -1;
|
||||
|
||||
if (this.api && !this._noApply && this.chartProps) {
|
||||
|
|
|
@ -1662,7 +1662,7 @@ define([
|
|||
this.paragraphControls.push(this.mnuInsertPageCount);
|
||||
|
||||
this.btnInsertChart.setMenu( new Common.UI.Menu({
|
||||
style: 'width: 435px;',
|
||||
style: 'width: 364px;',
|
||||
items: [
|
||||
{template: _.template('<div id="id-toolbar-menu-insertchart" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>')}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue