Fixing a broken key control in the menu
This commit is contained in:
parent
00ef0d4e9e
commit
34979a046a
|
@ -2159,40 +2159,43 @@ define([
|
||||||
onApiInitTableTemplates: function(images) {
|
onApiInitTableTemplates: function(images) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var store = this.getCollection('TableTemplates');
|
var store = this.getCollection('TableTemplates');
|
||||||
var hasCustomGroup = false;
|
|
||||||
var hasNoNameGroup = false;
|
|
||||||
this.fillTableTemplates();
|
this.fillTableTemplates();
|
||||||
|
|
||||||
if (store) {
|
if (store) {
|
||||||
var templates = [];
|
var templates = [];
|
||||||
var groups = [
|
var groups = [
|
||||||
{id: 'menu-table-group-custom', caption: me.txtGroupTable_Custom},
|
{id: 'menu-table-group-custom', caption: me.txtGroupTable_Custom, templates: []},
|
||||||
{id: 'menu-table-group-light', caption: me.txtGroupTable_Light},
|
{id: 'menu-table-group-light', caption: me.txtGroupTable_Light, templates: []},
|
||||||
{id: 'menu-table-group-medium', caption: me.txtGroupTable_Medium},
|
{id: 'menu-table-group-medium', caption: me.txtGroupTable_Medium, templates: []},
|
||||||
{id: 'menu-table-group-dark', caption: me.txtGroupTable_Dark},
|
{id: 'menu-table-group-dark', caption: me.txtGroupTable_Dark, templates: []},
|
||||||
{id: 'menu-table-group-no-name', caption: ' '},
|
{id: 'menu-table-group-no-name', caption: ' ', templates: []},
|
||||||
];
|
];
|
||||||
_.each(images, function(item) {
|
_.each(images, function(item) {
|
||||||
var tip = item.asc_getDisplayName();
|
var tip = item.asc_getDisplayName();
|
||||||
var groupItem = '';
|
var groupItem = '';
|
||||||
|
|
||||||
if (item.asc_getType()==0) {
|
if (item.asc_getType()==0) {
|
||||||
var arr = tip.split(' '),
|
var arr = tip.split(' '),
|
||||||
last = arr.pop();
|
last = arr.pop();
|
||||||
if(arr.length > 0){
|
|
||||||
groupItem = 'menu-table-group-' + arr[arr.length - 1].toLowerCase();
|
if(tip == 'None'){
|
||||||
|
groupItem = 'menu-table-group-light';
|
||||||
}
|
}
|
||||||
if(groups.some(function(item) {return item.id === groupItem;}) == false) {
|
else {
|
||||||
groupItem = 'menu-table-group-no-name';
|
if(arr.length > 0){
|
||||||
hasNoNameGroup = true;
|
groupItem = 'menu-table-group-' + arr[arr.length - 1].toLowerCase();
|
||||||
|
}
|
||||||
|
if(groups.some(function(item) {return item.id === groupItem;}) == false) {
|
||||||
|
groupItem = 'menu-table-group-no-name';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
arr = 'txtTable_' + arr.join('');
|
arr = 'txtTable_' + arr.join('');
|
||||||
tip = me[arr] ? me[arr] + ' ' + last : tip;
|
tip = me[arr] ? me[arr] + ' ' + last : tip;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
groupItem = 'menu-table-group-custom'
|
groupItem = 'menu-table-group-custom'
|
||||||
hasCustomGroup = true;
|
|
||||||
}
|
}
|
||||||
templates.push({
|
groups.filter(function(item){ return item.id == groupItem; })[0].templates.push({
|
||||||
name : item.asc_getName(),
|
name : item.asc_getName(),
|
||||||
caption : item.asc_getDisplayName(),
|
caption : item.asc_getDisplayName(),
|
||||||
type : item.asc_getType(),
|
type : item.asc_getType(),
|
||||||
|
@ -2204,17 +2207,15 @@ define([
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if(hasCustomGroup === false){
|
groups = groups.filter(function(item, index){
|
||||||
groups = groups.filter(function(item) {
|
return item.templates.length > 0
|
||||||
return item.id != 'menu-table-group-custom';
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
if(hasNoNameGroup === false){
|
|
||||||
groups = groups.filter(function(item) {
|
|
||||||
return item.id != 'menu-table-group-no-name';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
groups.forEach(function(item){
|
||||||
|
templates = templates.concat(item.templates);
|
||||||
|
delete item.templates;
|
||||||
|
});
|
||||||
|
|
||||||
me.toolbar.mnuTableTemplatePicker.groups.reset(groups);
|
me.toolbar.mnuTableTemplatePicker.groups.reset(groups);
|
||||||
store.reset(templates);
|
store.reset(templates);
|
||||||
}
|
}
|
||||||
|
|
|
@ -561,37 +561,40 @@ define([
|
||||||
$(data[index].el).find('img').attr('src', img);
|
$(data[index].el).find('img').attr('src', img);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var arrStyles = [];
|
var templates = [];
|
||||||
var groups = [
|
var groups = [
|
||||||
{id: 'menu-table-group-custom', caption: self.txtGroupTable_Custom},
|
{id: 'menu-table-group-custom', caption: self.txtGroupTable_Custom, templates: []},
|
||||||
{id: 'menu-table-group-light', caption: self.txtGroupTable_Light},
|
{id: 'menu-table-group-light', caption: self.txtGroupTable_Light, templates: []},
|
||||||
{id: 'menu-table-group-medium', caption: self.txtGroupTable_Medium},
|
{id: 'menu-table-group-medium', caption: self.txtGroupTable_Medium, templates: []},
|
||||||
{id: 'menu-table-group-dark', caption: self.txtGroupTable_Dark},
|
{id: 'menu-table-group-dark', caption: self.txtGroupTable_Dark, templates: []},
|
||||||
{id: 'menu-table-group-no-name', caption: ' '},
|
{id: 'menu-table-group-no-name', caption: ' ', templates: []},
|
||||||
];
|
];
|
||||||
var hasCustomGroup = false;
|
|
||||||
var hasNoNameGroup = false;
|
|
||||||
_.each(Templates, function(item){
|
_.each(Templates, function(item){
|
||||||
var tip = item.asc_getDisplayName();
|
var tip = item.asc_getDisplayName();
|
||||||
var groupItem = '';
|
var groupItem = '';
|
||||||
|
|
||||||
if (item.asc_getType()==0) {
|
if (item.asc_getType()==0) {
|
||||||
var arr = tip.split(' '),
|
var arr = tip.split(' '),
|
||||||
last = arr.pop();
|
last = arr.pop();
|
||||||
if(arr.length > 0){
|
|
||||||
groupItem = 'menu-table-group-' + arr[arr.length - 1].toLowerCase();
|
if(tip == 'None'){
|
||||||
|
groupItem = 'menu-table-group-light';
|
||||||
}
|
}
|
||||||
if(groups.some(function(item) {return item.id === groupItem;}) == false) {
|
else {
|
||||||
groupItem = 'menu-table-group-no-name';
|
if(arr.length > 0){
|
||||||
hasNoNameGroup = true;
|
groupItem = 'menu-table-group-' + arr[arr.length - 1].toLowerCase();
|
||||||
|
}
|
||||||
|
if(groups.some(function(item) {return item.id === groupItem;}) == false) {
|
||||||
|
groupItem = 'menu-table-group-no-name';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
arr = 'txtTable_' + arr.join('');
|
arr = 'txtTable_' + arr.join('');
|
||||||
tip = self[arr] ? self[arr] + ' ' + last : tip;
|
tip = self[arr] ? self[arr] + ' ' + last : tip;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
groupItem = 'menu-table-group-custom'
|
groupItem = 'menu-table-group-custom'
|
||||||
hasCustomGroup = true;
|
|
||||||
}
|
}
|
||||||
arrStyles.push({
|
groups.filter(function(item){ return item.id == groupItem; })[0].templates.push({
|
||||||
id : Common.UI.getId(),
|
id : Common.UI.getId(),
|
||||||
name : item.asc_getName(),
|
name : item.asc_getName(),
|
||||||
caption : item.asc_getDisplayName(),
|
caption : item.asc_getDisplayName(),
|
||||||
|
@ -603,19 +606,18 @@ define([
|
||||||
tip : tip
|
tip : tip
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if(hasCustomGroup === false){
|
|
||||||
groups = groups.filter(function(item) {
|
groups = groups.filter(function(item, index){
|
||||||
return item.id != 'menu-table-group-custom';
|
return item.templates.length > 0
|
||||||
});
|
});
|
||||||
}
|
|
||||||
if(hasNoNameGroup === false){
|
groups.forEach(function(item){
|
||||||
groups = groups.filter(function(item) {
|
templates = templates.concat(item.templates);
|
||||||
return item.id != 'menu-table-group-no-name';
|
delete item.templates;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
self.mnuTableTemplatePicker.groups.reset(groups);
|
self.mnuTableTemplatePicker.groups.reset(groups);
|
||||||
self.mnuTableTemplatePicker.store.reset(arrStyles);
|
self.mnuTableTemplatePicker.store.reset(templates);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -226,5 +226,20 @@
|
||||||
.group-description {
|
.group-description {
|
||||||
padding: 3px 0 3px 10px;
|
padding: 3px 0 3px 10px;
|
||||||
.font-weight-bold();
|
.font-weight-bold();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.group-items-container {
|
||||||
|
.item {
|
||||||
|
&:hover {
|
||||||
|
.box-shadow(0 0 0 2px @border-preview-hover-ie) !important;
|
||||||
|
.box-shadow(0 0 0 @scaled-two-px-value @border-preview-hover) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.selected {
|
||||||
|
.box-shadow(0 0 0 2px @border-preview-select-ie) !important;
|
||||||
|
.box-shadow(0 0 0 @scaled-two-px-value @border-preview-select) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -152,6 +152,20 @@
|
||||||
padding: 3px 0 3px 10px;
|
padding: 3px 0 3px 10px;
|
||||||
.font-weight-bold();
|
.font-weight-bold();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.group-items-container {
|
||||||
|
.item {
|
||||||
|
&:hover {
|
||||||
|
.box-shadow(0 0 0 2px @border-preview-hover-ie) !important;
|
||||||
|
.box-shadow(0 0 0 @scaled-two-px-value @border-preview-hover) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.selected {
|
||||||
|
.box-shadow(0 0 0 2px @border-preview-select-ie) !important;
|
||||||
|
.box-shadow(0 0 0 @scaled-two-px-value @border-preview-select) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.combo-styles {
|
.combo-styles {
|
||||||
|
|
Loading…
Reference in a new issue