[SSE] Add sparkline
This commit is contained in:
parent
5ab470ec5f
commit
8489136021
|
@ -62,7 +62,8 @@ define([
|
||||||
'spreadsheeteditor/main/app/view/ScaleDialog',
|
'spreadsheeteditor/main/app/view/ScaleDialog',
|
||||||
'spreadsheeteditor/main/app/view/FormatRulesManagerDlg',
|
'spreadsheeteditor/main/app/view/FormatRulesManagerDlg',
|
||||||
'spreadsheeteditor/main/app/view/SlicerAddDialog',
|
'spreadsheeteditor/main/app/view/SlicerAddDialog',
|
||||||
'spreadsheeteditor/main/app/view/AdvancedSeparatorDialog'
|
'spreadsheeteditor/main/app/view/AdvancedSeparatorDialog',
|
||||||
|
'spreadsheeteditor/main/app/view/CreateSparklineDialog'
|
||||||
], function () { 'use strict';
|
], function () { 'use strict';
|
||||||
|
|
||||||
SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({
|
SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({
|
||||||
|
@ -1079,22 +1080,10 @@ define([
|
||||||
if (!this.editMode) return;
|
if (!this.editMode) return;
|
||||||
var me = this,
|
var me = this,
|
||||||
info = me.api.asc_getCellInfo(),
|
info = me.api.asc_getCellInfo(),
|
||||||
seltype = info.asc_getSelectionType(),
|
seltype = info.asc_getSelectionType();
|
||||||
isSpark = (group == 'menu-chart-group-sparkcolumn' || group == 'menu-chart-group-sparkline' || group == 'menu-chart-group-sparkwin');
|
|
||||||
|
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
var win, props;
|
var win, props;
|
||||||
if (isSpark && (seltype==Asc.c_oAscSelectionType.RangeCells || seltype==Asc.c_oAscSelectionType.RangeCol ||
|
|
||||||
seltype==Asc.c_oAscSelectionType.RangeRow || seltype==Asc.c_oAscSelectionType.RangeMax)) {
|
|
||||||
var sparkLineInfo = info.asc_getSparklineInfo();
|
|
||||||
if (!!sparkLineInfo) {
|
|
||||||
var props = new Asc.sparklineGroup();
|
|
||||||
props.asc_setType(type);
|
|
||||||
this.api.asc_setSparklineGroup(sparkLineInfo.asc_getId(), props);
|
|
||||||
} else {
|
|
||||||
// add sparkline
|
|
||||||
}
|
|
||||||
} else if (!isSpark) {
|
|
||||||
var ischartedit = ( seltype == Asc.c_oAscSelectionType.RangeChart || seltype == Asc.c_oAscSelectionType.RangeChartText);
|
var ischartedit = ( seltype == Asc.c_oAscSelectionType.RangeChart || seltype == Asc.c_oAscSelectionType.RangeChartText);
|
||||||
props = me.api.asc_getChartObject(true); // don't lock chart object
|
props = me.api.asc_getChartObject(true); // don't lock chart object
|
||||||
if (props) {
|
if (props) {
|
||||||
|
@ -1127,7 +1116,6 @@ define([
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1146,7 +1134,19 @@ define([
|
||||||
props.asc_setType(type);
|
props.asc_setType(type);
|
||||||
this.api.asc_setSparklineGroup(sparkLineInfo.asc_getId(), props);
|
this.api.asc_setSparklineGroup(sparkLineInfo.asc_getId(), props);
|
||||||
} else {
|
} else {
|
||||||
// add sparkline
|
var me = this;
|
||||||
|
(new SSE.Views.CreateSparklineDialog(
|
||||||
|
{
|
||||||
|
api: me.api,
|
||||||
|
handler: function(result, settings) {
|
||||||
|
if (result == 'ok' && settings) {
|
||||||
|
me.view && me.view.fireEvent('insertspark', me.view);
|
||||||
|
if (settings.destination)
|
||||||
|
me.api.asc_addSparklineGroup(type, settings.source, settings.destination);
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
|
}
|
||||||
|
})).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2689,6 +2689,6 @@ define([
|
||||||
textAutoColor: 'Automatic',
|
textAutoColor: 'Automatic',
|
||||||
textItems: 'Items',
|
textItems: 'Items',
|
||||||
tipInsertSpark: 'Insert sparkline',
|
tipInsertSpark: 'Insert sparkline',
|
||||||
capInsertSpark: 'Sparkline'
|
capInsertSpark: 'Sparklines'
|
||||||
}, SSE.Views.Toolbar || {}));
|
}, SSE.Views.Toolbar || {}));
|
||||||
});
|
});
|
|
@ -3258,7 +3258,7 @@
|
||||||
"SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells",
|
"SSE.Views.Toolbar.txtUnmerge": "Unmerge Cells",
|
||||||
"SSE.Views.Toolbar.txtYen": "¥ Yen",
|
"SSE.Views.Toolbar.txtYen": "¥ Yen",
|
||||||
"SSE.Views.Toolbar.tipInsertSpark": "Insert sparkline",
|
"SSE.Views.Toolbar.tipInsertSpark": "Insert sparkline",
|
||||||
"SSE.Views.Toolbar.capInsertSpark": "Sparkline",
|
"SSE.Views.Toolbar.capInsertSpark": "Sparklines",
|
||||||
"SSE.Views.Top10FilterDialog.textType": "Show",
|
"SSE.Views.Top10FilterDialog.textType": "Show",
|
||||||
"SSE.Views.Top10FilterDialog.txtBottom": "Bottom",
|
"SSE.Views.Top10FilterDialog.txtBottom": "Bottom",
|
||||||
"SSE.Views.Top10FilterDialog.txtBy": "by",
|
"SSE.Views.Top10FilterDialog.txtBy": "by",
|
||||||
|
|
Loading…
Reference in a new issue