Commit b7f39044 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Bug 32608.

parent b4a34cb5
...@@ -2569,8 +2569,23 @@ define([ ...@@ -2569,8 +2569,23 @@ define([
if (me._state.tablename) if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname); me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else {
var settings = dlg.getSettings();
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_addAutoFilter(fmtname, settings.range)}, 1);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
else else
me.api.asc_addAutoFilter(fmtname, dlg.getSettings()); me.api.asc_addAutoFilter(fmtname, settings.range);
}
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
...@@ -2582,16 +2597,32 @@ define([ ...@@ -2582,16 +2597,32 @@ define([
win.show(); win.show();
win.setSettings({ win.setSettings({
api : me.api api : me.api,
selectionType: me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType()
}); });
} else { } else {
me._state.filter = undefined; me._state.filter = undefined;
if (me._state.tablename) if (me._state.tablename)
me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname); me.api.asc_changeAutoFilter(me._state.tablename, Asc.c_oAscChangeFilterOptions.style, fmtname);
else {
var selectionType = me.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType();
if (selectionType == Asc.c_oAscSelectionType.RangeMax || selectionType == Asc.c_oAscSelectionType.RangeRow ||
selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_addAutoFilter(fmtname)}, 1);
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}
});
else else
me.api.asc_addAutoFilter(fmtname); me.api.asc_addAutoFilter(fmtname);
} }
} }
}
}, },
onHideMenus: function(e){ onHideMenus: function(e){
...@@ -3022,7 +3053,9 @@ define([ ...@@ -3022,7 +3053,9 @@ define([
txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?', txtExpandSort: 'The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?',
txtExpand: 'Expand and sort', txtExpand: 'Expand and sort',
txtSorting: 'Sorting', txtSorting: 'Sorting',
txtSortSelected: 'Sort selected' txtSortSelected: 'Sort selected',
textLongOperation: 'Long operation',
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?'
}, SSE.Controllers.Toolbar || {})); }, SSE.Controllers.Toolbar || {}));
}); });
\ No newline at end of file
...@@ -136,7 +136,7 @@ define([ ...@@ -136,7 +136,7 @@ define([
}, },
onApiRangeChanged: function(info) { onApiRangeChanged: function(info) {
this.inputRange.setValue(info); this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error')) if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error'); this.inputRange.cmpEl.removeClass('error');
}, },
......
...@@ -74,6 +74,7 @@ define([ ...@@ -74,6 +74,7 @@ define([
this.options.tpl = _.template(this.template, this.options); this.options.tpl = _.template(this.template, this.options);
this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable; this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable;
this.selectionType = Asc.c_oAscSelectionType.RangeCells;
Common.UI.Window.prototype.initialize.call(this, this.options); Common.UI.Window.prototype.initialize.call(this, this.options);
}, },
...@@ -129,6 +130,8 @@ define([ ...@@ -129,6 +130,8 @@ define([
} }
if (settings.title) if (settings.title)
me.setTitle(settings.title); me.setTitle(settings.title);
if (settings.selectionType)
me.selectionType = settings.selectionType;
me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me)); me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
...@@ -145,15 +148,16 @@ define([ ...@@ -145,15 +148,16 @@ define([
if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) { if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) {
var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue()); var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());
options.asc_setIsTitle(this.cbTitle.checked); options.asc_setIsTitle(this.cbTitle.checked);
return options; return { selectionType: this.selectionType, range: options};
} else } else
return this.inputRange.getValue(); return { selectionType: this.selectionType, range: this.inputRange.getValue()};
}, },
onApiRangeChanged: function(info) { onApiRangeChanged: function(info) {
this.inputRange.setValue(info); this.inputRange.setValue(info.asc_getName());
if (this.inputRange.cmpEl.hasClass('error')) if (this.inputRange.cmpEl.hasClass('error'))
this.inputRange.cmpEl.removeClass('error'); this.inputRange.cmpEl.removeClass('error');
this.selectionType = info.asc_getType();
}, },
isRangeValid: function() { isRangeValid: function() {
......
...@@ -478,10 +478,25 @@ define([ ...@@ -478,10 +478,25 @@ define([
var handlerDlg = function(dlg, result) { var handlerDlg = function(dlg, result) {
if (result == 'ok') { if (result == 'ok') {
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None); me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
me.api.asc_changeTableRange(me._state.TableName, dlg.getSettings());
var settings = dlg.getSettings();
if (settings.selectionType == Asc.c_oAscSelectionType.RangeMax || settings.selectionType == Asc.c_oAscSelectionType.RangeRow ||
settings.selectionType == Asc.c_oAscSelectionType.RangeCol)
Common.UI.warning({
title: me.textLongOperation,
msg: me.warnLongOperation,
buttons: ['ok', 'cancel'],
callback: function(btn) {
if (btn == 'ok')
setTimeout(function() { me.api.asc_changeTableRange(me._state.TableName, settings.range)}, 1);
Common.NotificationCenter.trigger('edit:complete', me);
}
});
else
me.api.asc_changeTableRange(me._state.TableName, settings.range);
} }
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me);
}; };
var win = new SSE.Views.TableOptionsDialog({ var win = new SSE.Views.TableOptionsDialog({
handler: handlerDlg handler: handlerDlg
...@@ -545,7 +560,9 @@ define([ ...@@ -545,7 +560,9 @@ define([
notcriticalErrorTitle : 'Warning', notcriticalErrorTitle : 'Warning',
textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.', textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.',
textAdvanced: 'Show advanced settings', textAdvanced: 'Show advanced settings',
textConvertRange: 'Convert to range' textConvertRange: 'Convert to range',
textLongOperation: 'Long operation',
warnLongOperation: 'The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?'
}, SSE.Views.TableSettings || {})); }, SSE.Views.TableSettings || {}));
}); });
\ No newline at end of file
...@@ -702,6 +702,8 @@ ...@@ -702,6 +702,8 @@
"SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi", "SSE.Controllers.Toolbar.txtSymbol_xsi": "Xi",
"SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta", "SSE.Controllers.Toolbar.txtSymbol_zeta": "Zeta",
"SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?", "SSE.Controllers.Toolbar.warnMergeLostData": "Only the data from the upper-left cell will remain in the merged cell. <br>Are you sure you want to continue?",
"SSE.Controllers.Toolbar.textLongOperation": "Long operation",
"SSE.Controllers.Toolbar.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter", "SSE.Views.AutoFilterDialog.btnCustomFilter": "Custom Filter",
"SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel", "SSE.Views.AutoFilterDialog.cancelButtonText": "Cancel",
"SSE.Views.AutoFilterDialog.okButtonText": "OK", "SSE.Views.AutoFilterDialog.okButtonText": "OK",
...@@ -1483,6 +1485,8 @@ ...@@ -1483,6 +1485,8 @@
"SSE.Views.TableSettings.textTemplate": "Select From Template", "SSE.Views.TableSettings.textTemplate": "Select From Template",
"SSE.Views.TableSettings.textTotal": "Total", "SSE.Views.TableSettings.textTotal": "Total",
"SSE.Views.TableSettings.textConvertRange": "Convert to range", "SSE.Views.TableSettings.textConvertRange": "Convert to range",
"SSE.Views.TableSettings.textLongOperation": "Long operation",
"SSE.Views.TableSettings.warnLongOperation": "The operation you are about to perform might take rather much time to complete.<br>Are you sure you want to continue?",
"SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel", "SSE.Views.TableSettingsAdvanced.cancelButtonText": "Cancel",
"SSE.Views.TableSettingsAdvanced.okButtonText": "Ok", "SSE.Views.TableSettingsAdvanced.okButtonText": "Ok",
"SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text", "SSE.Views.TableSettingsAdvanced.textAlt": "Alternative Text",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment