Skip to content

Commit 467faff

Browse files
committed
fix
1 parent 621e1ff commit 467faff

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

web_src/js/features/common-form.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import $ from 'jquery';
2+
import {initAreYouSure} from '../vendor/jquery.are-you-sure.js';
23
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';
34

45
export function initGlobalFormDirtyLeaveConfirm() {
6+
initAreYouSure(window.jQuery);
57
// Warn users that try to leave a page after entering data into a form.
68
// Except on sign-in pages, and for forms marked as 'ignore-dirty'.
79
if (!$('.user.signin').length) {

web_src/js/vendor/jquery.are-you-sure.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
// Fork of the upstream module. The only changes are the addition of `const` on
2-
// lines 93 and 161 to make it strict mode compatible.
1+
// Fork of the upstream module. The only changes are:
2+
// * use export to make it work with ES6 modules.
3+
// * the addition of `const` to make it strict mode compatible.
34

45
/*!
56
* jQuery Plugin: Are-You-Sure (Dirty Form Detection)
@@ -13,7 +14,7 @@
1314
* Version: 1.9.0
1415
* Date: 13th August 2014
1516
*/
16-
(function($) {
17+
export function initAreYouSure($) {
1718

1819
$.fn.areYouSure = function(options) {
1920

@@ -192,4 +193,4 @@
192193
initForm($form);
193194
});
194195
};
195-
})(jQuery);
196+
}

0 commit comments

Comments
 (0)