diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 1addf0df4..07b5ad7cd 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -97,6 +97,9 @@ define([ row_column: { ttHeight: 20 }, + slicer: { + ttHeight: 20 + }, filter: {ttHeight: 40}, func_arg: {}, input_msg: {} @@ -957,7 +960,8 @@ define([ /** coauthoring end **/ index_locked, index_column, index_row, - index_filter; + index_filter, + index_slicer; for (var i = dataarray.length; i > 0; i--) { switch (dataarray[i-1].asc_getType()) { case Asc.c_oAscMouseMoveType.Hyperlink: @@ -980,6 +984,9 @@ define([ case Asc.c_oAscMouseMoveType.Filter: index_filter = i; break; + case Asc.c_oAscMouseMoveType.Tooltip: + index_slicer = i; + break; } } @@ -992,6 +999,7 @@ define([ hyperlinkTip = me.tooltips.hyperlink, row_columnTip = me.tooltips.row_column, filterTip = me.tooltips.filter, + slicerTip = me.tooltips.slicer, pos = [ me.documentHolder.cmpEl.offset().left - $(window).scrollLeft(), me.documentHolder.cmpEl.offset().top - $(window).scrollTop() @@ -1029,6 +1037,14 @@ define([ if (!index_locked) { me.hideCoAuthTips(); } + if (index_slicer===undefined) { + if (!slicerTip.isHidden && slicerTip.ref) { + slicerTip.ref.hide(); + slicerTip.ref = undefined; + slicerTip.text = ''; + slicerTip.isHidden = true; + } + } } if (index_filter===undefined || (me.dlgFilter && me.dlgFilter.isVisible()) || (me.currentMenu && me.currentMenu.isVisible())) { if (!filterTip.isHidden && filterTip.ref) { @@ -1038,7 +1054,6 @@ define([ filterTip.isHidden = true; } } - // show tooltips /** coauthoring begin **/ var getUserName = function(id){ @@ -1281,6 +1296,48 @@ define([ }); } } + + if (index_slicer!==undefined && me.permissions.isEdit) { + if (!slicerTip.parentEl) { + slicerTip.parentEl = $('
'); + me.documentHolder.cmpEl.append(slicerTip.parentEl); + } + + var data = dataarray[index_slicer-1], + str = data.asc_getTooltip(); + if (slicerTip.ref && slicerTip.ref.isVisible()) { + if (slicerTip.text != str) { + slicerTip.text = str; + slicerTip.ref.setTitle(str); + slicerTip.ref.updateTitle(); + } + } + + if (!slicerTip.ref || !slicerTip.ref.isVisible()) { + slicerTip.text = str; + slicerTip.ref = new Common.UI.Tooltip({ + owner : slicerTip.parentEl, + html : true, + title : str + }); + + slicerTip.ref.show([-10000, -10000]); + slicerTip.isHidden = false; + + showPoint = [data.asc_getX(), data.asc_getY()]; + showPoint[0] += (pos[0] + 6); + showPoint[1] += (pos[1] - 20 - slicerTip.ttHeight); + + var tipwidth = slicerTip.ref.getBSTip().$tip.width(); + if (showPoint[0] + tipwidth > me.tooltips.coauth.bodyWidth ) + showPoint[0] = me.tooltips.coauth.bodyWidth - tipwidth - 20; + + slicerTip.ref.getBSTip().$tip.css({ + top : showPoint[1] + 'px', + left: showPoint[0] + 'px' + }); + } + } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 2d716ff0b..69908a197 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -127,7 +127,9 @@ define([ 'Values': this.txtValues, 'Grand Total': this.txtGrandTotal, 'Row Labels': this.txtRowLbls, - 'Column Labels': this.txtColLbls + 'Column Labels': this.txtColLbls, + 'Multi-Select (Alt+S)': this.txtMultiSelect, + 'Clear Filter (Alt+C)': this.txtClearFilter }; styleNames.forEach(function(item){ translate[item] = me['txtStyle_' + item.replace(/ /g, '_')] || item; @@ -2548,7 +2550,9 @@ define([ txtRowLbls: 'Row Labels', txtColLbls: 'Column Labels', errNoDuplicates: 'No duplicate values found.', - errRemDuplicates: 'Duplicate values found and deleted: {0}, unique values left: {1}.' + errRemDuplicates: 'Duplicate values found and deleted: {0}, unique values left: {1}.', + txtMultiSelect: 'Multi-Select (Alt+S)', + txtClearFilter: 'Clear Filter (Alt+C)' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/app/view/SlicerSettings.js b/apps/spreadsheeteditor/main/app/view/SlicerSettings.js index ce0fb2e1a..c66ddc394 100644 --- a/apps/spreadsheeteditor/main/app/view/SlicerSettings.js +++ b/apps/spreadsheeteditor/main/app/view/SlicerSettings.js @@ -233,7 +233,7 @@ define([ value: '1', allowDecimal: false, maxValue: 20000, - minValue: 0 + minValue: 1 }); this.lockedControls.push(this.numCols); diff --git a/apps/spreadsheeteditor/main/app/view/SlicerSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/SlicerSettingsAdvanced.js index a2d177b53..57da61753 100644 --- a/apps/spreadsheeteditor/main/app/view/SlicerSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/SlicerSettingsAdvanced.js @@ -190,7 +190,7 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.tem value: '1', allowDecimal: false, maxValue: 20000, - minValue: 0 + minValue: 1 }); this.numCols.on('change', _.bind(function(field, newValue, oldValue, eOpts){ var numval = field.getNumberValue(); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index be7d1e351..87e382c73 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -814,6 +814,8 @@ "SSE.Controllers.Main.warnNoLicense": "This version of %1 editors has certain limitations for concurrent connections to the document server.