</script>
<li>
- <a href="#" onclick="if (sonarRecentHistory) { sonarRecentHistory.populateRecentHistoryPanel(); }; $j('#projects-menu').toggle(); return false;" class="link-more"><%= message('layout.projects') -%></a>
+ <a href="#" onclick="if (sonarRecentHistory) { sonarRecentHistory.populateRecentHistoryPanel(); }; showDropdownMenu('projects-menu'); return false;" class="link-more"><%= message('layout.projects') -%></a>
- <div id="projects-menu" class="dropdown-menu" style="max-width: none; display: none;" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
+ <div id="projects-menu" class="dropdown-menu" style="max-width: none; display: none;">
<div id="recent-history" style="border-bottom: 1px solid #ccc; padding-bottom: 10px;">
<h2><%= message('layout.recent_activity') -%></h2>
<ul id="recent-history-list">
<li>
- <a href="#" onclick="$j('#project-settings-menu').toggle(); return false;" class="link-more"><%= message('layout.configuration') -%></a>
+ <a href="#" onclick="showDropdownMenu('project-settings-menu'); return false;" class="link-more"><%= message('layout.configuration') -%></a>
- <div id="project-settings-menu" class="dropdown-menu" style="display: none" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
+ <div id="project-settings-menu" class="dropdown-menu" style="display: none">
<ul>
<% if (@project.project?) %>
<li><a href="<%= ApplicationController.root_context -%>/project/profile/<%= @project.id -%>"><%= message('project_quality_profiles.page') -%></a></li>
<li>
- <a href="#" onclick="$j('#user-panel').toggle(); return false;" class="link-more"><%= current_user.name(true) -%></a>
+ <a href="#" onclick="showDropdownMenu('user-panel'); return false;" class="link-more"><%= current_user.name(true) -%></a>
- <div id="user-panel" class="dropdown-menu" style="display: none" onmouseout="$j(this).hide();" onmouseover="$j(this).show();">
+ <div id="user-panel" class="dropdown-menu" style="display: none">
<ul>
<li><a href="<%= ApplicationController.root_context -%>/account/index"><%= message('layout.user_panel.my_profile') -%></a></li>
<li><a href="<%= ApplicationController.root_context -%>/sessions/logout" onclick="if (sonarRecentHistory) { sonarRecentHistory.clear(); }"><%= message('layout.logout') -%></a></li>
<% unless violation.switched_off? && violation.review && violation.review.resolved? %>
<div class="dropdown">
- <a href="#" class="link-action link-more" onclick="$('more<%= violation.id -%>').toggle();return false;"><%= message('more_actions') -%></a>
- <ul style="display: none" class="dropdown-menu" id="more<%= violation.id -%>" onmouseout="this.hide();" onmouseover="this.show();">
+ <a href="#" class="link-action link-more" onclick="showDropdownMenu('more<%= violation.id -%>');return false;"><%= message('more_actions') -%></a>
+ <ul style="display: none" class="dropdown-menu" id="more<%= violation.id -%>">
<% if !violation.switched_off? %>
<li><%= link_to_function (violation.review && violation.review.resolved? ? message('reviews.reopen') : message('reviews.resolved')),
"sCStF(#{violation.id})", :name => (violation.review && violation.review.resolved? ? 'bReopen' : 'bResolved') -%></li>
} catch (e) {
return false;
}
-}
\ No newline at end of file
+}
+
+var hideDropdownMenus = function() {
+ $j('.dropdown-menu').hide();
+ $j(document).unbind('mouseup', hideDropdownMenus);
+}
+
+function showDropdownMenu(menuId) {
+ $j(document).bind('mouseup', hideDropdownMenus);
+ $j('#' + menuId).show();
+}