Initial "click" handling for dropdown tabs
Still uncomplete, there are a number of edge cases that need to be handled. Keyboard navigation is one of them, hover/click distinction is another one. refs #6167
This commit is contained in:
parent
23679c0078
commit
19220a5a44
|
@ -114,6 +114,7 @@
|
||||||
$(document).on('mouseleave', '.historycolorgrid td', this.historycolorgidUnhover);
|
$(document).on('mouseleave', '.historycolorgrid td', this.historycolorgidUnhover);
|
||||||
$(document).on('mouseenter', 'li.dropdown', this.dropdownHover);
|
$(document).on('mouseenter', 'li.dropdown', this.dropdownHover);
|
||||||
$(document).on('mouseleave', 'li.dropdown', this.dropdownLeave);
|
$(document).on('mouseleave', 'li.dropdown', this.dropdownLeave);
|
||||||
|
|
||||||
$(document).on('mouseenter', '#menu > ul > li', this.menuTitleHovered);
|
$(document).on('mouseenter', '#menu > ul > li', this.menuTitleHovered);
|
||||||
$(document).on('mouseleave', '#sidebar', this.leaveSidebar);
|
$(document).on('mouseleave', '#sidebar', this.leaveSidebar);
|
||||||
$(document).on('click', '.tree .handle', { self: this }, this.treeNodeToggle);
|
$(document).on('click', '.tree .handle', { self: this }, this.treeNodeToggle);
|
||||||
|
@ -189,7 +190,7 @@
|
||||||
dropdownLeave: function () {
|
dropdownLeave: function () {
|
||||||
var $li = $(this);
|
var $li = $(this);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (! $li.is('li:hover')) {
|
if (! $li.is('li:hover') && ! $li.find(':focus')) {
|
||||||
$li.removeClass('hover');
|
$li.removeClass('hover');
|
||||||
}
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
|
@ -453,6 +454,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (href === '#') {
|
if (href === '#') {
|
||||||
|
// Allow to access dropdown menu by keyboard
|
||||||
|
if ($a.hasClass('dropdown-toggle')) {
|
||||||
|
$a.closest('li').toggleClass('hover');
|
||||||
|
}
|
||||||
|
// Ignore link, no action
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue