From 98853c63fde6e133dca6c723aaacfb1f368cad38 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Sun, 1 Apr 2012 18:06:49 +0200 Subject: [PATCH] JS: fix first part of #422; make items in drop-down acutally work --- mediagoblin/static/js/header_dropdown.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/mediagoblin/static/js/header_dropdown.js b/mediagoblin/static/js/header_dropdown.js index 57385203..643bafa4 100644 --- a/mediagoblin/static/js/header_dropdown.js +++ b/mediagoblin/static/js/header_dropdown.js @@ -18,15 +18,12 @@ $(document).ready(function() { $(".dropdown_items").hide(); - $(".dropdown").click(function(e) { - e.preventDefault(); - $(".dropdown_items").toggle(); - }); - $(".dropdown_items").mouseup(function() { - return false - }); $(document).mouseup(function(e) { - if($(e.target).not(".dropdown_items")) { + if($(e.target).is(".dropdown")) { + $(".dropdown_items").toggle(); + } else if($(e.target).is(".dropdown_items")) { + return; + } else { $(".dropdown_items").hide(); } }); -- 2.25.1