diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index d2431dc61..16c055c76 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2219,11 +2219,26 @@ define([ } else { var arr = []; var countCustomStyles = 0; + var hasNoNameGroup = false; _.each(styles, function(style, index){ + var styleGroup; + if(style.asc_getType() == 0) { + if(index - countCustomStyles < groups.length){ + styleGroup = groups[index - countCustomStyles]; + } + else { + styleGroup = 'menu-style-group-no-name'; + hasNoNameGroup = true; + } + } + else { + styleGroup = 'menu-style-group-custom'; + } + arr.push({ imageUrl: style.asc_getImage(), name : style.asc_getName(), - group : (style.asc_getType() == 0 ? groups[index - countCustomStyles] : 'menu-style-group-custom'), + group : styleGroup, tip : mainController.translationTable[style.get_Name()] || style.get_Name(), uid : Common.UI.getId() }); @@ -2231,13 +2246,21 @@ define([ countCustomStyles += 1; } }); + if(countCustomStyles == 0){ - listStyles.groups.models.forEach.forEach(function(style) { + listStyles.groups.models.forEach(function(style) { if(style.id === 'menu-style-group-custom'){ listStyles.groups.remove(style); } }); } + if(hasNoNameGroup === false){ + listStyles.groups.models.forEach(function(style) { + if(style.id === 'menu-style-group-no-name'){ + listStyles.groups.remove(style); + } + }); + } listStyles.menuPicker.store.reset(arr); } if (listStyles.menuPicker.store.length > 0 && listStyles.rendered) { diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index d85cd5fc6..df0084182 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1286,12 +1286,13 @@ define([ itemHeight : 40, style: 'min-width:158px;', groups: new Common.UI.DataViewGroupStore([ - {id: 'menu-style-group-custom', caption: this.textCustom }, - {id: 'menu-style-group-color', caption: this.textGoodBadAndNeutral }, - {id: 'menu-style-group-model', caption: this.textDataAndModel }, - {id: 'menu-style-group-title', caption: this.textTitlesAndHeadings }, - {id: 'menu-style-group-themed', caption: this.textThemedCallStyles }, - {id: 'menu-style-group-number', caption: this.textNumberFormat } + {id: 'menu-style-group-custom', caption: this.textCustom }, + {id: 'menu-style-group-color', caption: this.textGoodBadAndNeutral }, + {id: 'menu-style-group-model', caption: this.textDataAndModel }, + {id: 'menu-style-group-title', caption: this.textTitlesAndHeadings }, + {id: 'menu-style-group-themed', caption: this.textThemedCallStyles }, + {id: 'menu-style-group-number', caption: this.textNumberFormat }, + {id: 'menu-style-group-no-name', caption: this.textNoName } ]), menuMaxHeight : 350, lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set['FormatCells']], @@ -1305,7 +1306,7 @@ define([ minMenuColumn = 6; if (menu.cmpEl) { - var itemEl = $(menu.menuRoot.find('.dataview .group-items-container .item').get(0)); + var itemEl = $(menu.menuRoot.find('.dataview .item').get(0)); var itemMargin = parseFloat(itemEl.css('margin-left')) + parseFloat(itemEl.css('margin-right')); Common.Utils.applicationPixelRatio() > 1 && Common.Utils.applicationPixelRatio() < 2 && (itemMargin = -1/Common.Utils.applicationPixelRatio()); var itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) : @@ -3296,6 +3297,7 @@ define([ textDataAndModel: 'Data and Model', textTitlesAndHeadings: 'Titles and Headings', textThemedCallStyles: 'Themed Call Styles', - textNumberFormat: 'Number Format' + textNumberFormat: 'Number Format', + textNoName: 'No name' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index d444635c4..c5796843a 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -3457,6 +3457,7 @@ "SSE.Views.Toolbar.textTitlesAndHeadings": "Titles and Headings", "SSE.Views.Toolbar.textThemedCallStyles": "Themed Call Styles", "SSE.Views.Toolbar.textNumberFormat": "Number Format", + "SSE.Views.Toolbar.textNoName": "No Name", "SSE.Views.Toolbar.tipAlignBottom": "Align bottom", "SSE.Views.Toolbar.tipAlignCenter": "Align center", "SSE.Views.Toolbar.tipAlignJust": "Justified", diff --git a/apps/spreadsheeteditor/main/locale/ru.json b/apps/spreadsheeteditor/main/locale/ru.json index 099fca402..1a6e2bc6a 100644 --- a/apps/spreadsheeteditor/main/locale/ru.json +++ b/apps/spreadsheeteditor/main/locale/ru.json @@ -3455,6 +3455,7 @@ "SSE.Views.Toolbar.textTitlesAndHeadings": "Названия и заголовки", "SSE.Views.Toolbar.textThemedCallStyles": "Стили ячеек с темой", "SSE.Views.Toolbar.textNumberFormat": "Числовой формат", + "SSE.Views.Toolbar.textNoName": "Без имени", "SSE.Views.Toolbar.tipAlignBottom": "Выровнять по нижнему краю", "SSE.Views.Toolbar.tipAlignCenter": "Выровнять по центру", "SSE.Views.Toolbar.tipAlignJust": "Выровнять по ширине",