diff options
| author | 2015-06-01 19:40:30 +0200 | |
|---|---|---|
| committer | 2015-06-01 19:40:30 +0200 | |
| commit | 137c498c84da23f9abad2217c5fd716d6c514573 (patch) | |
| tree | c4bcf466e174c9abc1f15b29e8940e5fabad803d /p | |
| parent | ae277ddefcd7b5a776ec4b30562d5dca6479b6dd (diff) | |
| parent | 384a146883548ba0274f8cbee0c2e67dc053f70e (diff) | |
Merge from dev
https://github.com/FreshRSS/FreshRSS/issues/312
Diffstat (limited to 'p')
| -rw-r--r-- | p/scripts/main.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index eaf6067f7..f64927c14 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1230,13 +1230,11 @@ function init_slider_observers() { } function init_configuration_alert() { - $(window).on('beforeunload', function(e){ - if (e.originalEvent.explicitOriginalTarget.type === 'submit') { - // we don't want an alert when submitting the form with the submit button - return; - } - if ($(e.originalEvent.explicitOriginalTarget).attr('data-leave-validation') !== undefined) { - // we don't want an alert when submitting the form by pressing the enter key + $(window).on('submit', function(e) { + window.hasSubmit = true; + }); + $(window).on('beforeunload', function(e) { + if (window.hasSubmit) { return; } var fields = $("[data-leave-validation]"); |
