Browse Source

Add escape key for modals

Jeremy Thomas 8 years ago
parent
commit
9caa0407c2
2 changed files with 8 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 7 0
      docs/javascript/bulma.js

+ 1 - 0
CHANGELOG.md

@@ -12,6 +12,7 @@
 * Split icon container dimensions and icon size
 * Split icon container dimensions and icon size
 * Fix delete button by using pixels instead of (r)em
 * Fix delete button by using pixels instead of (r)em
 * Fix level on mobile
 * Fix level on mobile
+* Add new `.is-spaced` modifer for titles and subtitles
 
 
 ## 0.3.2
 ## 0.3.2
 
 

+ 7 - 0
docs/javascript/bulma.js

@@ -24,6 +24,13 @@ jQuery(document).ready(function ($) {
     $('#modal-ter').removeClass('is-active');
     $('#modal-ter').removeClass('is-active');
   });
   });
 
 
+  $(document).on('keyup',function(e) {
+    if (e.keyCode == 27) {
+      $('html').removeClass('is-clipped');
+      $('.modal').removeClass('is-active');
+    }
+  });
+
   var $highlights = $('.highlight');
   var $highlights = $('.highlight');
 
 
   $highlights.each(function() {
   $highlights.each(function() {