diff --git a/config/lib/mediaInfo.js b/config/lib/mediaInfo.js index f2aa6e7d..a616e46a 100644 --- a/config/lib/mediaInfo.js +++ b/config/lib/mediaInfo.js @@ -537,7 +537,7 @@ module.exports.getMediaInfo = function (nfo) { res = gInfo.match(reg); if (res) { res.forEach(function (st) { - var st = st.replace(/^[^\:]+.\s*/, ''); + st = st.replace(/^[^\:]+.\s*/, ''); if (!minfo.hasOwnProperty('text')) { minfo.text = {}; } diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js index 8baba03d..3c993e14 100644 --- a/modules/core/client/controllers/header.client.controller.js +++ b/modules/core/client/controllers/header.client.controller.js @@ -45,31 +45,45 @@ $('.popup_wrapper').remove(); } }); - - //set menu bar opened when hover - $('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 (evt) { - $(this).unbind('click'); - if ($(this).hasClass('open')) { - $(this).find('.dropdown-toggle', this).trigger('click'); - } - }); }); + /** + * bindHoverToMenuItem + */ + vm.bindHoverToMenuItem = function () { + //set menu bar opened when hover + $timeout(function () { + $('div.navbar-mt ul.nav li.dropdown').off('mouseenter mouseleave').hover(function (evt) { + if (!$(this).hasClass('open')) { + $(this).find('.dropdown-toggle', this).trigger('click'); + $(this).off('click').on('click', function (e) { + var sta = $(this).find('.dropdown-toggle', this).attr('alt'); + if (sta) { + $state.go(sta); + } + }); + } + }, function (evt) { + $(this).off('click'); + if ($(this).hasClass('open')) { + $(this).find('.dropdown-toggle', this).trigger('click'); + } + }); + + $('div.navbar-mt ul.nav li.dropdown ul.dropdown-menu').off('mouseenter mouseleave').hover(function (evt) { + $(this).parent().off('click'); + }, function (evt) { + }); + }, 0); + }; + /** * auth-user-changed */ $scope.$on('auth-user-changed', function (event, args) { vm.user = Authentication.user; vm.scoreLevelData = vm.user ? ScoreLevelService.getScoreLevelJson(vm.user.score) : undefined; + vm.bindHoverToMenuItem(); vm.getInvitationsCount(); vm.getWarning(); vm.getCountUnread(); diff --git a/modules/core/client/views/header.client.view.html b/modules/core/client/views/header.client.view.html index b50325ba..27fc391d 100644 --- a/modules/core/client/views/header.client.view.html +++ b/modules/core/client/views/header.client.view.html @@ -1,5 +1,5 @@