Commit 37313fb5 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Bug 32196.

parent 675ef1fb
...@@ -162,8 +162,8 @@ define([ ...@@ -162,8 +162,8 @@ define([
view.menuAddHyperlink.on('click', _.bind(me.onInsHyperlink, me)); view.menuAddHyperlink.on('click', _.bind(me.onInsHyperlink, me));
view.menuEditHyperlink.on('click', _.bind(me.onInsHyperlink, me)); view.menuEditHyperlink.on('click', _.bind(me.onInsHyperlink, me));
view.menuRemoveHyperlink.on('click', _.bind(me.onDelHyperlink, me)); view.menuRemoveHyperlink.on('click', _.bind(me.onDelHyperlink, me));
view.pmiRowHeight.on('click', _.bind(me.onSetSize, me)); view.pmiRowHeight.menu.on('item:click', _.bind(me.onSetSize, me));
view.pmiColumnWidth.on('click', _.bind(me.onSetSize, me)); view.pmiColumnWidth.menu.on('item:click', _.bind(me.onSetSize, me));
view.pmiEntireHide.on('click', _.bind(me.onEntireHide, me)); view.pmiEntireHide.on('click', _.bind(me.onEntireHide, me));
view.pmiEntireShow.on('click', _.bind(me.onEntireShow, me)); view.pmiEntireShow.on('click', _.bind(me.onEntireShow, me));
view.pmiFreezePanes.on('click', _.bind(me.onFreezePanes, me)); view.pmiFreezePanes.on('click', _.bind(me.onFreezePanes, me));
...@@ -479,24 +479,29 @@ define([ ...@@ -479,24 +479,29 @@ define([
} }
}, },
onSetSize: function(item) { onSetSize: function(menu, item) {
var me = this; if (item.value == 'row-height' || item.value == 'column-width') {
(new SSE.Views.SetValueDialog({ var me = this;
title: item.caption, (new SSE.Views.SetValueDialog({
startvalue: item.options.action == 'row-height' ? me.api.asc_getRowHeight() : me.api.asc_getColumnWidth(), title: item.caption,
maxvalue: item.options.action == 'row-height' ? Asc.c_oAscMaxRowHeight : Asc.c_oAscMaxColumnWidth, startvalue: item.value == 'row-height' ? me.api.asc_getRowHeight() : me.api.asc_getColumnWidth(),
step: item.options.action == 'row-height' ? 0.75 : 1, maxvalue: item.value == 'row-height' ? Asc.c_oAscMaxRowHeight : Asc.c_oAscMaxColumnWidth,
defaultUnit: item.options.action == 'row-height' ? Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt) : me.textSym, step: item.value == 'row-height' ? 0.75 : 1,
handler: function(dlg, result) { defaultUnit: item.value == 'row-height' ? Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt) : me.textSym,
if (result == 'ok') { handler: function(dlg, result) {
var val = dlg.getSettings(); if (result == 'ok') {
if (!isNaN(val)) var val = dlg.getSettings();
(item.options.action == 'row-height') ? me.api.asc_setRowHeight(val) : me.api.asc_setColumnWidth(val); if (!isNaN(val))
} (item.value == 'row-height') ? me.api.asc_setRowHeight(val) : me.api.asc_setColumnWidth(val);
}
Common.NotificationCenter.trigger('edit:complete', me.documentHolder); Common.NotificationCenter.trigger('edit:complete', me.documentHolder);
} }
})).show(); })).show();
} else {
(item.value == 'auto-row-height') ? this.api.asc_autoFitRowHeight() : this.api.asc_autoFitColumnWidth();
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
}
}, },
onEntireHide: function(item) { onEntireHide: function(item) {
...@@ -1532,7 +1537,6 @@ define([ ...@@ -1532,7 +1537,6 @@ define([
guestText : 'Guest', guestText : 'Guest',
textCtrlClick : 'Press CTRL and click link', textCtrlClick : 'Press CTRL and click link',
txtRowHeight : 'Row Height',
txtHeight : 'Height', txtHeight : 'Height',
txtWidth : 'Width', txtWidth : 'Width',
tipIsLocked : 'This element is being edited by another user.', tipIsLocked : 'This element is being edited by another user.',
......
...@@ -299,12 +299,24 @@ define([ ...@@ -299,12 +299,24 @@ define([
me.pmiRowHeight = new Common.UI.MenuItem({ me.pmiRowHeight = new Common.UI.MenuItem({
caption : me.txtRowHeight, caption : me.txtRowHeight,
action: 'row-height' menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items : [
{ caption: me.txtAutoRowHeight, value: 'auto-row-height' },
{ caption: me.txtCustomRowHeight, value: 'row-height' }
]
})
}); });
me.pmiColumnWidth = new Common.UI.MenuItem({ me.pmiColumnWidth = new Common.UI.MenuItem({
caption : me.txtColumnWidth, caption : me.txtColumnWidth,
action: 'column-width' menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items : [
{ caption: me.txtAutoColumnWidth, value: 'auto-column-width' },
{ caption: me.txtCustomColumnWidth, value: 'column-width' }
]
})
}); });
me.pmiEntireHide = new Common.UI.MenuItem({ me.pmiEntireHide = new Common.UI.MenuItem({
...@@ -621,8 +633,8 @@ define([ ...@@ -621,8 +633,8 @@ define([
txtShiftDown: 'Shift cells down', txtShiftDown: 'Shift cells down',
txtRow: 'Entire Row', txtRow: 'Entire Row',
txtColumn: 'Entire Column', txtColumn: 'Entire Column',
txtColumnWidth: 'Column Width', txtColumnWidth: 'Set Column Width',
txtRowHeight: 'Row Height', txtRowHeight: 'Set Row Height',
txtWidth: 'Width', txtWidth: 'Width',
txtHide: 'Hide', txtHide: 'Hide',
txtShow: 'Show', txtShow: 'Show',
...@@ -670,6 +682,11 @@ define([ ...@@ -670,6 +682,11 @@ define([
txtFilterFontColor: 'Filter by font color', txtFilterFontColor: 'Filter by font color',
txtReapply: 'Reapply', txtReapply: 'Reapply',
txtSortCellColor: 'Selected Cell Color on top', txtSortCellColor: 'Selected Cell Color on top',
txtSortFontColor: 'Selected Font Color on top' txtSortFontColor: 'Selected Font Color on top',
txtAutoColumnWidth: 'Auto Fit Column Width',
txtAutoRowHeight: 'Auto Fit Row Height',
txtCustomColumnWidth: 'Custom Column Width',
txtCustomRowHeight: 'Custom Row Height'
}, SSE.Views.DocumentHolder || {})); }, SSE.Views.DocumentHolder || {}));
}); });
\ No newline at end of file
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
"SSE.Views.DocumentHolder.txtClearHyper": "Hyperlinks", "SSE.Views.DocumentHolder.txtClearHyper": "Hyperlinks",
"SSE.Views.DocumentHolder.txtClearText": "Text", "SSE.Views.DocumentHolder.txtClearText": "Text",
"SSE.Views.DocumentHolder.txtColumn": "Entire column", "SSE.Views.DocumentHolder.txtColumn": "Entire column",
"SSE.Views.DocumentHolder.txtColumnWidth": "Column Width", "SSE.Views.DocumentHolder.txtColumnWidth": "Set Column Width",
"SSE.Views.DocumentHolder.txtCopy": "Copy", "SSE.Views.DocumentHolder.txtCopy": "Copy",
"SSE.Views.DocumentHolder.txtCut": "Cut", "SSE.Views.DocumentHolder.txtCut": "Cut",
"SSE.Views.DocumentHolder.txtDelete": "Delete", "SSE.Views.DocumentHolder.txtDelete": "Delete",
...@@ -483,7 +483,7 @@ ...@@ -483,7 +483,7 @@
"SSE.Views.DocumentHolder.txtPaste": "Paste", "SSE.Views.DocumentHolder.txtPaste": "Paste",
"SSE.Views.DocumentHolder.txtReapply": "Reapply", "SSE.Views.DocumentHolder.txtReapply": "Reapply",
"SSE.Views.DocumentHolder.txtRow": "Entire row", "SSE.Views.DocumentHolder.txtRow": "Entire row",
"SSE.Views.DocumentHolder.txtRowHeight": "Row Height", "SSE.Views.DocumentHolder.txtRowHeight": "Set Row Height",
"SSE.Views.DocumentHolder.txtSelect": "Select", "SSE.Views.DocumentHolder.txtSelect": "Select",
"SSE.Views.DocumentHolder.txtShiftDown": "Shift cells down", "SSE.Views.DocumentHolder.txtShiftDown": "Shift cells down",
"SSE.Views.DocumentHolder.txtShiftLeft": "Shift cells left", "SSE.Views.DocumentHolder.txtShiftLeft": "Shift cells left",
...@@ -497,6 +497,10 @@ ...@@ -497,6 +497,10 @@
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup", "SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
"SSE.Views.DocumentHolder.txtWidth": "Width", "SSE.Views.DocumentHolder.txtWidth": "Width",
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", "SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"SSE.Views.DocumentHolder.txtAutoColumnWidth": "Auto Fit Column Width",
"SSE.Views.DocumentHolder.txtAutoRowHeight": "Auto Fit Row Height",
"SSE.Views.DocumentHolder.txtCustomColumnWidth": "Custom Column Width",
"SSE.Views.DocumentHolder.txtCustomRowHeight": "Custom Row Height",
"SSE.Views.FileMenu.btnBackCaption": "Go to Documents", "SSE.Views.FileMenu.btnBackCaption": "Go to Documents",
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New", "SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
"SSE.Views.FileMenu.btnDownloadCaption": "Download as...", "SSE.Views.FileMenu.btnDownloadCaption": "Download as...",
......
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