]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
turning on key up capture only when a reveal window is open 4151/head
authorbtsai <btsai@cerego.co.jp>
Wed, 15 Jan 2014 07:57:30 +0000 (16:57 +0900)
committerbtsai <btsai@cerego.co.jp>
Wed, 15 Jan 2014 07:57:30 +0000 (16:57 +0900)
js/foundation/foundation.reveal.js

index 21e83556a83c5a8336d9fe6ad7af5b43d62172ec..8aaa184ba81015904a48ecd9425eae82000f3634 100644 (file)
           .on('closed.fndtn.reveal', '[data-reveal]', this.close_video);
       }
 
+      return true;
+    },
+
+    // PATCH #3: turning on key up capture only when a reveal window is open
+    key_up_on : function (scope) {
+      var self = this;
+
       // PATCH #1: fixing multiple keyup event trigger from single key press
       $('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) {
         var open_modal = $('[data-reveal].open'),
       return true;
     },
 
+    // PATCH #3: turning on key up capture only when a reveal window is open
+    key_up_off : function (scope) {
+      $('body').off('keyup.fndtn.reveal');
+      return true;
+    },
+
     open : function (target, ajax_settings) {
       var self = this;
       if (target) {
             .data('offset', this.cache_offset(modal));
         }
 
+        this.key_up_on(modal);    // PATCH #3: turning on key up capture only when a reveal window is open
         modal.trigger('open');
 
         if (open_modal.length < 1) {
 
       if (open_modals.length > 0) {
         this.locked = true;
+        this.key_up_off(modal);   // PATCH #3: turning on key up capture only when a reveal window is open
         modal.trigger('close');
         this.toggle_bg(modal);
         this.hide(open_modals, settings.css.close, settings);