Merge pull request #521 from ONLYOFFICE/fix/sse-chart-data
[SSE] Select chart data in diagramm mode
This commit is contained in:
commit
65d4be70c9
|
@ -274,6 +274,7 @@ define([
|
||||||
if (toolbar.cmbNumberFormat.cmpEl)
|
if (toolbar.cmbNumberFormat.cmpEl)
|
||||||
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
|
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
|
||||||
toolbar.btnEditChart.on('click', _.bind(this.onEditChart, this));
|
toolbar.btnEditChart.on('click', _.bind(this.onEditChart, this));
|
||||||
|
toolbar.btnEditChartData.on('click', _.bind(this.onEditChartData, this));
|
||||||
} else
|
} else
|
||||||
if ( me.appConfig.isEditMailMerge ) {
|
if ( me.appConfig.isEditMailMerge ) {
|
||||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||||
|
@ -968,6 +969,35 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onEditChartData: function(btn) {
|
||||||
|
if (!this.editMode) return;
|
||||||
|
|
||||||
|
var me = this;
|
||||||
|
var props;
|
||||||
|
if (me.api){
|
||||||
|
props = me.api.asc_getChartObject();
|
||||||
|
if (props) {
|
||||||
|
me._isEditRanges = true;
|
||||||
|
props.startEdit();
|
||||||
|
var win = new SSE.Views.ChartDataDialog({
|
||||||
|
chartSettings: props,
|
||||||
|
api: me.api,
|
||||||
|
handler: function(result, value) {
|
||||||
|
if (result == 'ok') {
|
||||||
|
props.endEdit();
|
||||||
|
me._isEditRanges = false;
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
|
}
|
||||||
|
}).on('close', function() {
|
||||||
|
me._isEditRanges && props.cancelEdit();
|
||||||
|
me._isEditRanges = false;
|
||||||
|
});
|
||||||
|
win.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onSelectChart: function(group, type) {
|
onSelectChart: function(group, type) {
|
||||||
if (!this.editMode) return;
|
if (!this.editMode) return;
|
||||||
var me = this,
|
var me = this,
|
||||||
|
@ -1817,7 +1847,7 @@ define([
|
||||||
var toolbar = this.toolbar;
|
var toolbar = this.toolbar;
|
||||||
if (toolbar.mode.isEditDiagram || toolbar.mode.isEditMailMerge) {
|
if (toolbar.mode.isEditDiagram || toolbar.mode.isEditMailMerge) {
|
||||||
is_cell_edited = (state == Asc.c_oAscCellEditorState.editStart);
|
is_cell_edited = (state == Asc.c_oAscCellEditorState.editStart);
|
||||||
toolbar.lockToolbar(SSE.enumLock.editCell, state == Asc.c_oAscCellEditorState.editStart, {array: [toolbar.btnDecDecimal,toolbar.btnIncDecimal,toolbar.cmbNumberFormat]});
|
toolbar.lockToolbar(SSE.enumLock.editCell, state == Asc.c_oAscCellEditorState.editStart, {array: [toolbar.btnDecDecimal,toolbar.btnIncDecimal,toolbar.cmbNumberFormat, toolbar.btnEditChartData]});
|
||||||
} else
|
} else
|
||||||
if (state == Asc.c_oAscCellEditorState.editStart || state == Asc.c_oAscCellEditorState.editEnd) {
|
if (state == Asc.c_oAscCellEditorState.editStart || state == Asc.c_oAscCellEditorState.editEnd) {
|
||||||
toolbar.lockToolbar(SSE.enumLock.editCell, state == Asc.c_oAscCellEditorState.editStart, {
|
toolbar.lockToolbar(SSE.enumLock.editCell, state == Asc.c_oAscCellEditorState.editStart, {
|
||||||
|
@ -2556,6 +2586,10 @@ define([
|
||||||
|
|
||||||
if ( _disableEditOptions(selectionType, coauth_disable) ) return;
|
if ( _disableEditOptions(selectionType, coauth_disable) ) return;
|
||||||
|
|
||||||
|
var need_disable = (selectionType === Asc.c_oAscSelectionType.RangeCells || selectionType === Asc.c_oAscSelectionType.RangeCol ||
|
||||||
|
selectionType === Asc.c_oAscSelectionType.RangeRow || selectionType === Asc.c_oAscSelectionType.RangeMax);
|
||||||
|
this.toolbar.lockToolbar( SSE.enumLock.selRange, need_disable, {array:[this.toolbar.btnEditChartData]} );
|
||||||
|
|
||||||
if (selectionType == Asc.c_oAscSelectionType.RangeChart || selectionType == Asc.c_oAscSelectionType.RangeChartText)
|
if (selectionType == Asc.c_oAscSelectionType.RangeChart || selectionType == Asc.c_oAscSelectionType.RangeChartText)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<div class="elset">
|
<div class="elset">
|
||||||
<span class="btn-slot border" id="slot-btn-chart" style="width: auto;"></span>
|
<span class="btn-slot border" id="slot-btn-chart" style="width: auto;"></span>
|
||||||
|
<span class="btn-slot border" id="slot-btn-chart-data" style="width: auto;margin-left: 12px;"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="group" style="width: 100%;"></div>
|
<div class="group" style="width: 100%;"></div>
|
||||||
|
|
|
@ -276,6 +276,14 @@ define([
|
||||||
lock : [_set.lostConnect],
|
lock : [_set.lostConnect],
|
||||||
style : 'width: 120px;'
|
style : 'width: 120px;'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.btnEditChartData = new Common.UI.Button({
|
||||||
|
id : 'id-toolbar-rtn-edit-chart-data',
|
||||||
|
cls : 'btn-toolbar btn-text-value',
|
||||||
|
caption : me.tipEditChartData,
|
||||||
|
lock : [_set.editCell, _set.selRange, _set.selRangeEdit, _set.lostConnect],
|
||||||
|
style : 'width: 120px;'
|
||||||
|
});
|
||||||
} else
|
} else
|
||||||
if ( config.isEditMailMerge ) {
|
if ( config.isEditMailMerge ) {
|
||||||
me.$layout = $(_.template(simple)(config));
|
me.$layout = $(_.template(simple)(config));
|
||||||
|
@ -1629,6 +1637,7 @@ define([
|
||||||
_injectComponent('#slot-btn-inschart', this.btnInsertChart);
|
_injectComponent('#slot-btn-inschart', this.btnInsertChart);
|
||||||
_injectComponent('#slot-field-styles', this.listStyles);
|
_injectComponent('#slot-field-styles', this.listStyles);
|
||||||
_injectComponent('#slot-btn-chart', this.btnEditChart);
|
_injectComponent('#slot-btn-chart', this.btnEditChart);
|
||||||
|
_injectComponent('#slot-btn-chart-data', this.btnEditChartData);
|
||||||
_injectComponent('#slot-btn-pageorient', this.btnPageOrient);
|
_injectComponent('#slot-btn-pageorient', this.btnPageOrient);
|
||||||
_injectComponent('#slot-btn-pagemargins', this.btnPageMargins);
|
_injectComponent('#slot-btn-pagemargins', this.btnPageMargins);
|
||||||
_injectComponent('#slot-btn-pagesize', this.btnPageSize);
|
_injectComponent('#slot-btn-pagesize', this.btnPageSize);
|
||||||
|
@ -1973,7 +1982,7 @@ define([
|
||||||
if (mode.isDisconnected) {
|
if (mode.isDisconnected) {
|
||||||
this.lockToolbar( SSE.enumLock.lostConnect, true );
|
this.lockToolbar( SSE.enumLock.lostConnect, true );
|
||||||
this.lockToolbar( SSE.enumLock.lostConnect, true,
|
this.lockToolbar( SSE.enumLock.lostConnect, true,
|
||||||
{array:[this.btnEditChart,this.btnUndo,this.btnRedo]} );
|
{array:[this.btnEditChart, this.btnEditChartData, this.btnUndo,this.btnRedo]} );
|
||||||
if (!mode.enableDownload)
|
if (!mode.enableDownload)
|
||||||
this.lockToolbar(SSE.enumLock.cantPrint, true, {array: [this.btnPrint]});
|
this.lockToolbar(SSE.enumLock.cantPrint, true, {array: [this.btnPrint]});
|
||||||
} else {
|
} else {
|
||||||
|
@ -2436,6 +2445,7 @@ define([
|
||||||
capBtnInsSlicer: 'Slicer',
|
capBtnInsSlicer: 'Slicer',
|
||||||
tipInsertSlicer: 'Insert slicer',
|
tipInsertSlicer: 'Insert slicer',
|
||||||
textVertical: 'Vertical Text',
|
textVertical: 'Vertical Text',
|
||||||
textTabView: 'View'
|
textTabView: 'View',
|
||||||
|
tipEditChartData: 'Select Data'
|
||||||
}, SSE.Views.Toolbar || {}));
|
}, SSE.Views.Toolbar || {}));
|
||||||
});
|
});
|
|
@ -2896,6 +2896,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.textTabView": "View",
|
"SSE.Views.Toolbar.textTabView": "View",
|
||||||
|
"SSE.Views.Toolbar.tipEditChartData": "Select Data",
|
||||||
"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