3235: Bind Esc key to close modals.
authorTom Clegg <tom@curoverse.com>
Sun, 27 Jul 2014 22:35:46 +0000 (18:35 -0400)
committerTom Clegg <tom@curoverse.com>
Sun, 27 Jul 2014 22:35:46 +0000 (18:35 -0400)
apps/workbench/app/assets/javascripts/application.js

index d21c4b5625447617b9f4ceaea33f8762e8f69f26..cbca4c0fc3973ac687ffbd38dc3524aa1fa801cd 100644 (file)
@@ -135,11 +135,13 @@ jQuery(function($){
         on('ajax:complete ready', function() {
             // See http://getbootstrap.com/javascript/#buttons
             $('.btn').button();
-        });
-
-    $(document).
+        }).
         on('ready ajax:complete', function() {
             $('[data-toggle~=tooltip]').tooltip({container:'body'});
+        }).
+        on('ready ajax:complete', function() {
+            // This makes the dialog close on Esc key, obviously.
+            $('.modal').attr('tabindex', '-1')
         });
 
     HeaderRowFixer = function(selector) {