[DE] Fix svg icon for chart type

This commit is contained in:
Julia Radzhabova 2020-05-06 17:17:03 +03:00
parent a939187601
commit fd5c8d5f79
4 changed files with 22 additions and 10 deletions

View file

@ -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) {

View file

@ -777,6 +777,12 @@
position: relative;
}
svg.icon {
vertical-align: middle;
width: 52px;
padding: 5px;
}
&:hover,
.over,
&:active,

View file

@ -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) {

View file

@ -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>')}
]