Added group "No Name"
If a style does not have a group, it is added to the group "No name"
This commit is contained in:
parent
bb7613bd44
commit
b4dd4a4f91
|
@ -2219,11 +2219,26 @@ define([
|
||||||
} else {
|
} else {
|
||||||
var arr = [];
|
var arr = [];
|
||||||
var countCustomStyles = 0;
|
var countCustomStyles = 0;
|
||||||
|
var hasNoNameGroup = false;
|
||||||
_.each(styles, function(style, index){
|
_.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({
|
arr.push({
|
||||||
imageUrl: style.asc_getImage(),
|
imageUrl: style.asc_getImage(),
|
||||||
name : style.asc_getName(),
|
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(),
|
tip : mainController.translationTable[style.get_Name()] || style.get_Name(),
|
||||||
uid : Common.UI.getId()
|
uid : Common.UI.getId()
|
||||||
});
|
});
|
||||||
|
@ -2231,13 +2246,21 @@ define([
|
||||||
countCustomStyles += 1;
|
countCustomStyles += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(countCustomStyles == 0){
|
if(countCustomStyles == 0){
|
||||||
listStyles.groups.models.forEach.forEach(function(style) {
|
listStyles.groups.models.forEach(function(style) {
|
||||||
if(style.id === 'menu-style-group-custom'){
|
if(style.id === 'menu-style-group-custom'){
|
||||||
listStyles.groups.remove(style);
|
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);
|
listStyles.menuPicker.store.reset(arr);
|
||||||
}
|
}
|
||||||
if (listStyles.menuPicker.store.length > 0 && listStyles.rendered) {
|
if (listStyles.menuPicker.store.length > 0 && listStyles.rendered) {
|
||||||
|
|
|
@ -1291,7 +1291,8 @@ define([
|
||||||
{id: 'menu-style-group-model', caption: this.textDataAndModel },
|
{id: 'menu-style-group-model', caption: this.textDataAndModel },
|
||||||
{id: 'menu-style-group-title', caption: this.textTitlesAndHeadings },
|
{id: 'menu-style-group-title', caption: this.textTitlesAndHeadings },
|
||||||
{id: 'menu-style-group-themed', caption: this.textThemedCallStyles },
|
{id: 'menu-style-group-themed', caption: this.textThemedCallStyles },
|
||||||
{id: 'menu-style-group-number', caption: this.textNumberFormat }
|
{id: 'menu-style-group-number', caption: this.textNumberFormat },
|
||||||
|
{id: 'menu-style-group-no-name', caption: this.textNoName }
|
||||||
]),
|
]),
|
||||||
menuMaxHeight : 350,
|
menuMaxHeight : 350,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selSlicer, _set.lostConnect, _set.coAuth, _set['FormatCells']],
|
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;
|
minMenuColumn = 6;
|
||||||
|
|
||||||
if (menu.cmpEl) {
|
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'));
|
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());
|
Common.Utils.applicationPixelRatio() > 1 && Common.Utils.applicationPixelRatio() < 2 && (itemMargin = -1/Common.Utils.applicationPixelRatio());
|
||||||
var itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) :
|
var itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) :
|
||||||
|
@ -3296,6 +3297,7 @@ define([
|
||||||
textDataAndModel: 'Data and Model',
|
textDataAndModel: 'Data and Model',
|
||||||
textTitlesAndHeadings: 'Titles and Headings',
|
textTitlesAndHeadings: 'Titles and Headings',
|
||||||
textThemedCallStyles: 'Themed Call Styles',
|
textThemedCallStyles: 'Themed Call Styles',
|
||||||
textNumberFormat: 'Number Format'
|
textNumberFormat: 'Number Format',
|
||||||
|
textNoName: 'No name'
|
||||||
}, SSE.Views.Toolbar || {}));
|
}, SSE.Views.Toolbar || {}));
|
||||||
});
|
});
|
|
@ -3457,6 +3457,7 @@
|
||||||
"SSE.Views.Toolbar.textTitlesAndHeadings": "Titles and Headings",
|
"SSE.Views.Toolbar.textTitlesAndHeadings": "Titles and Headings",
|
||||||
"SSE.Views.Toolbar.textThemedCallStyles": "Themed Call Styles",
|
"SSE.Views.Toolbar.textThemedCallStyles": "Themed Call Styles",
|
||||||
"SSE.Views.Toolbar.textNumberFormat": "Number Format",
|
"SSE.Views.Toolbar.textNumberFormat": "Number Format",
|
||||||
|
"SSE.Views.Toolbar.textNoName": "No Name",
|
||||||
"SSE.Views.Toolbar.tipAlignBottom": "Align bottom",
|
"SSE.Views.Toolbar.tipAlignBottom": "Align bottom",
|
||||||
"SSE.Views.Toolbar.tipAlignCenter": "Align center",
|
"SSE.Views.Toolbar.tipAlignCenter": "Align center",
|
||||||
"SSE.Views.Toolbar.tipAlignJust": "Justified",
|
"SSE.Views.Toolbar.tipAlignJust": "Justified",
|
||||||
|
|
|
@ -3455,6 +3455,7 @@
|
||||||
"SSE.Views.Toolbar.textTitlesAndHeadings": "Названия и заголовки",
|
"SSE.Views.Toolbar.textTitlesAndHeadings": "Названия и заголовки",
|
||||||
"SSE.Views.Toolbar.textThemedCallStyles": "Стили ячеек с темой",
|
"SSE.Views.Toolbar.textThemedCallStyles": "Стили ячеек с темой",
|
||||||
"SSE.Views.Toolbar.textNumberFormat": "Числовой формат",
|
"SSE.Views.Toolbar.textNumberFormat": "Числовой формат",
|
||||||
|
"SSE.Views.Toolbar.textNoName": "Без имени",
|
||||||
"SSE.Views.Toolbar.tipAlignBottom": "Выровнять по нижнему краю",
|
"SSE.Views.Toolbar.tipAlignBottom": "Выровнять по нижнему краю",
|
||||||
"SSE.Views.Toolbar.tipAlignCenter": "Выровнять по центру",
|
"SSE.Views.Toolbar.tipAlignCenter": "Выровнять по центру",
|
||||||
"SSE.Views.Toolbar.tipAlignJust": "Выровнять по ширине",
|
"SSE.Views.Toolbar.tipAlignJust": "Выровнять по ширине",
|
||||||
|
|
Loading…
Reference in a new issue