]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
offcanvas animation fix for anchor tags 4414/head
authorNikhilKalige <NikhilKalige@users.noreply.github.com>
Mon, 10 Feb 2014 16:50:56 +0000 (22:20 +0530)
committerNikhilKalige <NikhilKalige@users.noreply.github.com>
Mon, 10 Feb 2014 16:50:56 +0000 (22:20 +0530)
A fix for #4411. I have added bind event for transition end, that triggers the href jump once the transition is done. I am not sure if it is the proper way. But it works and i have tested in latest versions of firefox and chrome.

js/foundation/foundation.offcanvas.js

index df688ef49471811452a27d77db3435a5c8427828..0bbfc7853c220a0c12ec1bec42677b7051aecd88 100644 (file)
           e.preventDefault();
           S(".off-canvas-wrap").removeClass("move-right");
         })
+        .on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) {
+          e.preventDefault();
+          var href = $(this).attr('href');
+          S('.off-canvas-wrap').on('transitionend webkitTransitionEnd oTransitionEnd', function(e) {
+              window.location = href
+              S('.off-canvas-wrap').off('transitionend webkitTransitionEnd oTransitionEnd');
+          });
+          S(".off-canvas-wrap").removeClass("move-right");
+        })
         .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
           e.preventDefault();
           S(this).closest(".off-canvas-wrap").toggleClass("move-left");
         .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
           e.preventDefault();
           S(".off-canvas-wrap").removeClass("move-left");
+        })
+        .on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) {
+          e.preventDefault();
+          var href = $(this).attr('href');
+          S('.off-canvas-wrap').on('transitionend webkitTransitionEnd oTransitionEnd', function(e) {
+              window.location = href
+              S('.off-canvas-wrap').off('transitionend webkitTransitionEnd oTransitionEnd');
+          });
+          S(".off-canvas-wrap").removeClass("move-left");
         });
     },