feat(core): dropdown menu item default event

This commit is contained in:
OldHawk
2018-05-16 16:43:44 +08:00
parent 44e664ecac
commit b95cc5d7f0
4 changed files with 15 additions and 6 deletions

View File

@@ -47,11 +47,17 @@
});
//set menu bar opened when hover
$('div.navbar-mt ul.nav li.dropdown').hover(function () {
$('div.navbar-mt ul.nav li.dropdown').hover(function (evt) {
if (!$(this).hasClass('open')) {
$(this).find('.dropdown-toggle', this).trigger('click');
$(this).bind('click', function (e) {
var sta = $(this).find('.dropdown-toggle', this).attr('alt');
if (sta)
$state.go(sta);
});
}
}, function () {
}, function (evt) {
$(this).unbind('click');
if ($(this).hasClass('open')) {
$(this).find('.dropdown-toggle', this).trigger('click');
}