[SSE] Check before ungroup cells

This commit is contained in:
Julia Radzhabova 2019-06-05 14:19:33 +03:00
parent 27b7286119
commit 0330f6b148

View file

@ -113,24 +113,29 @@ define([
}, },
onUngroup: function(type) { onUngroup: function(type) {
var me = this; var me = this,
val = me.api.asc_checkAddGroup(true); // check ungroup
if (type=='rows') { if (type=='rows') {
me.api.asc_ungroup(true) (val!==undefined) && me.api.asc_ungroup(true)
} else if (type=='columns') { } else if (type=='columns') {
me.api.asc_ungroup(false) (val!==undefined) && me.api.asc_ungroup(false)
} else if (type=='clear') { } else if (type=='clear') {
me.api.asc_clearOutline(); me.api.asc_clearOutline();
} else } else {
(new SSE.Views.GroupDialog({ if (val===null) {
title: me.view.capBtnUngroup, (new SSE.Views.GroupDialog({
props: 'rows', title: me.view.capBtnUngroup,
handler: function (dlg, result) { props: 'rows',
if (result=='ok') { handler: function (dlg, result) {
me.api.asc_ungroup(dlg.getSettings()); if (result=='ok') {
me.api.asc_ungroup(dlg.getSettings());
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); })).show();
} } else if (val!==undefined) //undefined - error, true - rows, false - columns
})).show(); me.api.asc_ungroup(val);
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, },