[SSE] Fix color palette in submenu (move with keys)

This commit is contained in:
Julia Radzhabova 2022-04-28 15:09:38 +03:00
parent 34a466c8c1
commit 503fdc3db7
3 changed files with 22 additions and 6 deletions

View file

@ -533,7 +533,11 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
items : [ items : [
{ template: _.template('<div id="format-rules-borders-menu-bordercolor" style="width: 164px; display: inline-block;"></div>'), stopPropagation: true }, { template: _.template('<div id="format-rules-borders-menu-bordercolor" style="width: 164px; display: inline-block;"></div>'), stopPropagation: true },
{caption: '--'}, {caption: '--'},
{ template: _.template('<a id="format-rules-borders-menu-new-bordercolor" style="padding-left:12px;">' + this.textNewColor + '</a>'), stopPropagation: true } {
id: "format-rules-borders-menu-new-bordercolor",
template: _.template('<a tabindex="-1" type="menuitem" style="padding-left:12px;">' + this.textNewColor + '</a>'),
stopPropagation: true
}
] ]
}) })
}) })
@ -543,8 +547,10 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
this.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this)); this.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this));
this.btnBorders.on('click', _.bind(this.onBorders, this)); this.btnBorders.on('click', _.bind(this.onBorders, this));
this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({ this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({
el: $('#format-rules-borders-menu-bordercolor') el: $('#format-rules-borders-menu-bordercolor'),
outerMenu: {menu: this.mnuBorderColor.menu, index: 0}
}); });
this.mnuBorderColor.menu.setInnerMenu([{menu: this.mnuBorderColorPicker, index: 0}]);
this.mnuBorderColorPicker.on('select', _.bind(this.onBordersColor, this)); this.mnuBorderColorPicker.on('select', _.bind(this.onBordersColor, this));
$('#format-rules-borders-menu-new-bordercolor').on('click', _.bind(function() { $('#format-rules-borders-menu-new-bordercolor').on('click', _.bind(function() {
me.mnuBorderColorPicker.addNewColor(); me.mnuBorderColorPicker.addNewColor();

View file

@ -337,7 +337,10 @@ define([
items: [ items: [
{ template: _.template('<div id="id-tab-menu-color" style="width: 164px;display: inline-block;"></div>') }, { template: _.template('<div id="id-tab-menu-color" style="width: 164px;display: inline-block;"></div>') },
{caption: '--'}, {caption: '--'},
{ template: _.template('<a id="id-tab-menu-new-color" style="padding-left:12px;">' + me.textNewColor + '</a>') } {
id: "id-tab-menu-new-color",
template: _.template('<a tabindex="-1" type="menuitem" style="padding-left:12px;">' + me.textNewColor + '</a>')
}
] ]
}); });
@ -374,9 +377,10 @@ define([
}).on('render:after', function(btn) { }).on('render:after', function(btn) {
me.mnuTabColor = new Common.UI.ThemeColorPalette({ me.mnuTabColor = new Common.UI.ThemeColorPalette({
el: $('#id-tab-menu-color'), el: $('#id-tab-menu-color'),
outerMenu: {menu: menuColorItems, index: 0},
transparent: true transparent: true
}); });
menuColorItems.setInnerMenu([{menu: me.mnuTabColor, index: 0}]);
me.mnuTabColor.on('select', function(picker, color) { me.mnuTabColor.on('select', function(picker, color) {
me.fireEvent('sheet:setcolor', [color]); me.fireEvent('sheet:setcolor', [color]);
}); });

View file

@ -2122,15 +2122,21 @@ define([
{caption: '--'}, {caption: '--'},
{ template: _.template('<div id="id-toolbar-menu-bordercolor" style="width: 164px;display: inline-block;"></div>'), stopPropagation: true }, { template: _.template('<div id="id-toolbar-menu-bordercolor" style="width: 164px;display: inline-block;"></div>'), stopPropagation: true },
{caption: '--'}, {caption: '--'},
{ template: _.template('<a id="id-toolbar-menu-new-bordercolor" style="padding-left:12px;">' + this.textNewColor + '</a>'), stopPropagation: true } {
id: "id-toolbar-menu-new-bordercolor",
template: _.template('<a tabindex="-1" type="menuitem" style="padding-left:12px;">' + this.textNewColor + '</a>'),
stopPropagation: true
}
] ]
}) })
}) })
] ]
})); }));
this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({ this.mnuBorderColorPicker = new Common.UI.ThemeColorPalette({
el: $('#id-toolbar-menu-bordercolor') el: $('#id-toolbar-menu-bordercolor'),
outerMenu: {menu: this.mnuBorderColor.menu, index: 2}
}); });
this.mnuBorderColor.menu.setInnerMenu([{menu: this.mnuBorderColorPicker, index: 2}]);
} }
if ( this.btnInsertChart ) { if ( this.btnInsertChart ) {