From a9850f64b3c5007d2bef2e1067c081b85740ae09 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 10 Jun 2020 15:32:23 +0300 Subject: [PATCH] [SSE] Fix named ranges for slicer --- .../main/app/controller/DocumentHolder.js | 20 +++++++++++++++---- .../main/app/view/NameManagerDlg.js | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 2d724b7bc..e35085aae 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2146,10 +2146,22 @@ define([ var type = menuItem.asc_getType(), name = menuItem.asc_getName(true), origname = me.api.asc_getFormulaNameByLocale(name), - mnu = new Common.UI.MenuItem({ - iconCls: 'menu__icon ' + ((type==Asc.c_oAscPopUpSelectorType.Func) ? 'btn-function': ((type==Asc.c_oAscPopUpSelectorType.Table) ? 'btn-menu-table' : 'btn-named-range')) , - caption: name, - hint : (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : '' + iconCls = 'btn-named-range'; + switch (type) { + case Asc.c_oAscPopUpSelectorType.Func: + iconCls = 'btn-function'; + break; + case Asc.c_oAscPopUpSelectorType.Table: + iconCls = 'btn-menu-table'; + break; + case Asc.c_oAscPopUpSelectorType.Slicer: + iconCls = 'btn-slicer'; + break; + } + var mnu = new Common.UI.MenuItem({ + iconCls: 'menu__icon ' + iconCls , + caption: name, + hint : (funcdesc && funcdesc[origname]) ? funcdesc[origname].d : '' }).on('click', function(item, e) { setTimeout(function(){ me.api.asc_insertInCell(item.caption, type, false ); }, 10); }); diff --git a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js index e0eb6bf0d..3bd12f438 100644 --- a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js @@ -195,7 +195,7 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template', name: this.ranges[i].asc_getName(true), scope: scope, scopeName: (scope===null) ? this.textWorkbook: this.sheetNames[scope], - range: this.ranges[i].asc_getRef(), + range: (type===Asc.c_oAscDefNameType.slicer) ? '' : this.ranges[i].asc_getRef(), lock: (id!==null && id!==undefined), lockuser: (id) ? this.getUserName(id) : this.guestText, type: type,