aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-05-29 23:32:01 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2015-05-29 23:32:01 +0200
commita39e48e811641b66efdc799cf674ce3bbf6b4c7c (patch)
tree5110e9b9fbd2364bd14be0a0e4208323f4587f7b
parented811431a57404f407226ed5fcacf2805531a0d8 (diff)
parentf79f2a7e986f40291865e54074ab62fcb9909bb4 (diff)
Merge remote-tracking branch 'origin/ConfirmationChrome' into dev
-rw-r--r--p/scripts/main.js12
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]");