From 359351adf2dc50921bc2f8a8ddda66563dcb4c1c Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 18 Sep 2014 17:32:58 -0700 Subject: [PATCH] Ignoring beforeunload when submitting from within a modal --- themes/grav/js/pages-all.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/themes/grav/js/pages-all.js b/themes/grav/js/pages-all.js index c167cbd5..835f4ca8 100644 --- a/themes/grav/js/pages-all.js +++ b/themes/grav/js/pages-all.js @@ -39,6 +39,10 @@ $(function(){ $(window).off('beforeunload'); }); + $('[data-remodal-id] form').on('submit', function(){ + $(window).off('beforeunload'); + }); + $("#admin-mode-toggle input[name=mode-switch]").on('change', function(e){ var value = $(this).val();