[SSE] Set focus to palette on menu open
This commit is contained in:
parent
503fdc3db7
commit
7690bd393a
|
@ -132,6 +132,15 @@ define([
|
||||||
this.updateColors(this.options.updateColorsArr[0], this.options.updateColorsArr[1]);
|
this.updateColors(this.options.updateColorsArr[0], this.options.updateColorsArr[1]);
|
||||||
if (this.options.value)
|
if (this.options.value)
|
||||||
this.select(this.options.value, true);
|
this.select(this.options.value, true);
|
||||||
|
if (this.options.outerMenu && this.options.outerMenu.focusOnShow && this.options.outerMenu.menu) {
|
||||||
|
el.addClass('focused');
|
||||||
|
this.options.outerMenu.menu.on('show:after', function(menu) {
|
||||||
|
_.delay(function() {
|
||||||
|
me.showLastSelected();
|
||||||
|
me.focus();
|
||||||
|
}, 10);
|
||||||
|
});
|
||||||
|
}
|
||||||
this.updateCustomColors();
|
this.updateCustomColors();
|
||||||
el.closest('.btn-group').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
el.closest('.btn-group').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
||||||
el.closest('.dropdown-submenu').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
el.closest('.dropdown-submenu').on('show.bs.dropdown', _.bind(this.updateCustomColors, this));
|
||||||
|
|
|
@ -128,8 +128,9 @@ function patchDropDownKeyDown(e) {
|
||||||
var mnu = $('> [role=menu]', li),
|
var mnu = $('> [role=menu]', li),
|
||||||
$subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'),
|
$subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'),
|
||||||
$dataviews = mnu.find('> li:not(.divider):not(.disabled):visible .dataview'),
|
$dataviews = mnu.find('> li:not(.divider):not(.disabled):visible .dataview'),
|
||||||
|
$palette = mnu.find('> li:not(.divider):not(.disabled):visible .theme-colorpalette.focused'),
|
||||||
$internal_menu = mnu.find('> li:not(.divider):not(.disabled):visible ul.internal-menu');
|
$internal_menu = mnu.find('> li:not(.divider):not(.disabled):visible ul.internal-menu');
|
||||||
if ($subitems.length>0 && $dataviews.length<1 && $internal_menu.length<1)
|
if ($subitems.length>0 && $dataviews.length<1 && $internal_menu.length<1 && $palette.length<1)
|
||||||
($subitems.index($subitems.filter(':focus'))<0) && $subitems.eq(0).focus();
|
($subitems.index($subitems.filter(':focus'))<0) && $subitems.eq(0).focus();
|
||||||
}, 250);
|
}, 250);
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,7 +548,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
|
||||||
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}
|
outerMenu: {menu: this.mnuBorderColor.menu, index: 0, focusOnShow: true}
|
||||||
});
|
});
|
||||||
this.mnuBorderColor.menu.setInnerMenu([{menu: this.mnuBorderColorPicker, 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));
|
||||||
|
|
|
@ -377,12 +377,15 @@ 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},
|
outerMenu: {menu: menuColorItems, index: 0, focusOnShow: true},
|
||||||
transparent: true
|
transparent: true
|
||||||
});
|
});
|
||||||
menuColorItems.setInnerMenu([{menu: me.mnuTabColor, index: 0}]);
|
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]);
|
||||||
|
setTimeout(function(){
|
||||||
|
me.tabMenu.hide();
|
||||||
|
}, 1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue