Browse Source

Fix cancellation of slider exit (#7705)

Previously when you clicked the "Cancel" button inside of the confirm dialog, the slider would close anyway.
Inverle 9 months ago
parent
commit
118356ee58
1 changed files with 2 additions and 3 deletions
  1. 2 3
      p/scripts/extra.js

+ 2 - 3
p/scripts/extra.js

@@ -348,10 +348,9 @@ function close_slider_listener(ev) {
 	if (data_leave_validation(slider) || confirm(context.i18n.confirmation_default)) {
 		slider.querySelectorAll('form').forEach(function (f) { f.reset(); });
 		document.documentElement.classList.remove('slider-active');
-		return true;
-	} else {
-		return false;
+		return;
 	}
+	ev.preventDefault();
 }
 // </slider>