[SSE] Advanced chart settings: hide chart type button and tab

This commit is contained in:
Julia Radzhabova 2020-08-19 19:54:02 +03:00
parent 526b3684c0
commit 8decfb1b43

View file

@ -114,29 +114,29 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
// Layout // Layout
this.btnChartType = new Common.UI.Button({ // this.btnChartType = new Common.UI.Button({
cls : 'btn-large-dataview', // cls : 'btn-large-dataview',
iconCls : 'svgicon chart-bar-normal', // iconCls : 'svgicon chart-bar-normal',
menu : new Common.UI.Menu({ // menu : new Common.UI.Menu({
style: 'width: 364px; padding-top: 12px;', // style: 'width: 364px; padding-top: 12px;',
additionalAlign: this.menuAddAlign, // additionalAlign: this.menuAddAlign,
items: [ // items: [
{ template: _.template('<div id="id-chart-dlg-menu-type" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') } // { template: _.template('<div id="id-chart-dlg-menu-type" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>') }
] // ]
}) // })
}); // });
this.btnChartType.on('render:after', function(btn) { // this.btnChartType.on('render:after', function(btn) {
me.mnuChartTypePicker = new Common.UI.DataView({ // me.mnuChartTypePicker = new Common.UI.DataView({
el: $('#id-chart-dlg-menu-type'), // el: $('#id-chart-dlg-menu-type'),
parentMenu: btn.menu, // parentMenu: btn.menu,
restoreHeight: 421, // restoreHeight: 421,
groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()), // groups: new Common.UI.DataViewGroupStore(Common.define.chartData.getChartGroupData()),
store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()), // store: new Common.UI.DataViewStore(Common.define.chartData.getChartData()),
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>') // itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist"><svg width="40" height="40" class=\"icon\"><use xlink:href=\"#chart-<%= iconCls %>\"></use></svg></div>')
}); // });
}); // });
this.btnChartType.render($('#chart-dlg-button-type')); // this.btnChartType.render($('#chart-dlg-button-type'));
this.mnuChartTypePicker.on('item:click', _.bind(this.onSelectType, this, this.btnChartType)); // this.mnuChartTypePicker.on('item:click', _.bind(this.onSelectType, this, this.btnChartType));
// this.cmbDataDirect = new Common.UI.ComboBox({ // this.cmbDataDirect = new Common.UI.ComboBox({
// el : $('#chart-dlg-combo-range'), // el : $('#chart-dlg-combo-range'),
@ -979,11 +979,11 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.setTitle((this.isChart) ? this.textTitle : this.textTitleSparkline); this.setTitle((this.isChart) ? this.textTitle : this.textTitleSparkline);
this.btnsCategory[0].setVisible(false); // hide type for charts
if (this.isChart) { if (this.isChart) {
this.btnsCategory[4].setVisible(false); this.btnsCategory[4].setVisible(false);
this.btnsCategory[5].setVisible(false); this.btnsCategory[5].setVisible(false);
} else { } else {
this.btnsCategory[0].setVisible(false);
this.btnsCategory[1].setVisible(false); this.btnsCategory[1].setVisible(false);
this.btnsCategory[2].setVisible(false); this.btnsCategory[2].setVisible(false);
this.btnsCategory[3].setVisible(false); this.btnsCategory[3].setVisible(false);
@ -1284,12 +1284,12 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
// Layout // Layout
var record = this.mnuChartTypePicker.store.findWhere({type: this._state.ChartType}); // var record = this.mnuChartTypePicker.store.findWhere({type: this._state.ChartType});
this.mnuChartTypePicker.selectRecord(record, true); // this.mnuChartTypePicker.selectRecord(record, true);
if (record) { // if (record) {
this.btnChartType.setIconCls('svgicon ' + 'chart-' + record.get('iconCls')); // this.btnChartType.setIconCls('svgicon ' + 'chart-' + record.get('iconCls'));
} else // } else
this.btnChartType.setIconCls('svgicon'); // this.btnChartType.setIconCls('svgicon');
this._noApply = false; this._noApply = false;
@ -1418,8 +1418,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
var value; var value;
if (this.isChart) { if (this.isChart) {
var rec = this.mnuChartTypePicker.getSelectedRec(), // var rec = this.mnuChartTypePicker.getSelectedRec(),
type = (rec) ? rec.get('type') : this.currentChartType; // type = (rec) ? rec.get('type') : this.currentChartType;
var type = this.currentChartType;
this.chartSettings.putType(type); this.chartSettings.putType(type);
@ -1488,8 +1489,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
var isvalid, var isvalid,
range = this.chartSettings.getRange(); range = this.chartSettings.getRange();
if (!_.isEmpty(range)) { if (!_.isEmpty(range)) {
var rec = this.mnuChartTypePicker.getSelectedRec(), // var rec = this.mnuChartTypePicker.getSelectedRec(),
type = (rec) ? rec.get('type') : this.currentChartType; // type = (rec) ? rec.get('type') : this.currentChartType;
var type = this.currentChartType;
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, !this.chartSettings.getInColumns(), type); isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, !this.chartSettings.getInColumns(), type);
if (isvalid == Asc.c_oAscError.ID.No) if (isvalid == Asc.c_oAscError.ID.No)