← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13121: in ip-feed, if dropdown is visible, and user clicks gear again, hide dropdown

 

------------------------------------------------------------
revno: 13121
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-03 11:10:00 +0100
message:
  in ip-feed, if dropdown is visible, and user clicks gear again, hide dropdown
modified:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2013-12-03 09:47:08 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/interpretationFeed.vm	2013-12-03 10:10:00 +0000
@@ -31,12 +31,15 @@
 
   jQuery('.interpretationContainer').on('click', '.gearDropDown', function( e ) {
     var jqTarget = jQuery(e.target).closest('.gearDropDown');
-
     jQuery('.gearDropDown').removeClass('active');
+
+    if(dropDown.is(':visible')) {
+      dropDown.hide();
+      return false;
+    }
+
     jqTarget.addClass('active');
-
     dropDown.show();
-
     dropDown.css({
       top: jqTarget.offset().top + jqTarget.innerHeight(),
       left: jqTarget.offset().left - 34
@@ -51,6 +54,13 @@
       dropDown.hide();
     }
   });
+
+  $(document).keyup(function( e ) {
+    if( e.keyCode == 27 ) {
+      jQuery('.gearDropDown').removeClass('active');
+      dropDown.hide();
+    }
+  });
 });
 </script>