Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web_src/js/features/common-form.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import $ from 'jquery';
import {initAreYouSure} from '../vendor/jquery.are-you-sure.js';
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';

export function initGlobalFormDirtyLeaveConfirm() {
initAreYouSure(window.jQuery);
// Warn users that try to leave a page after entering data into a form.
// Except on sign-in pages, and for forms marked as 'ignore-dirty'.
if (!$('.user.signin').length) {
Expand Down
9 changes: 5 additions & 4 deletions web_src/js/vendor/jquery.are-you-sure.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Fork of the upstream module. The only changes are the addition of `const` on
// lines 93 and 161 to make it strict mode compatible.
// Fork of the upstream module. The only changes are:
// * use export to make it work with ES6 modules.
// * the addition of `const` to make it strict mode compatible.

/*!
* jQuery Plugin: Are-You-Sure (Dirty Form Detection)
Expand All @@ -13,7 +14,7 @@
* Version: 1.9.0
* Date: 13th August 2014
*/
(function($) {
export function initAreYouSure($) {

$.fn.areYouSure = function(options) {

Expand Down Expand Up @@ -192,4 +193,4 @@
initForm($form);
});
};
})(jQuery);
}