JS: fix first part of #422; make items in drop-down acutally work
authorJef van Schendel <mail@jefvanschendel.nl>
Sun, 1 Apr 2012 16:06:49 +0000 (18:06 +0200)
committerJef van Schendel <mail@jefvanschendel.nl>
Sun, 1 Apr 2012 16:06:49 +0000 (18:06 +0200)
mediagoblin/static/js/header_dropdown.js

index 573852036cae82f7914eb7d967edd43881871235..643bafa44d7cb8a364480acc02c863ac36d6d514 100644 (file)
 
 $(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();
     }
   });