Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @file
|
||||
* Javascript behaviors for unsaved webforms.
|
||||
* JavaScript behaviors for unsaved webforms.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
|
@ -26,14 +26,38 @@
|
|||
unsaved = true;
|
||||
}
|
||||
else {
|
||||
$('.js-webform-unsaved :input:not(input[type=\'submit\'])', context).once('webform-unsaved').on('change keypress', function () {
|
||||
unsaved = true;
|
||||
$('.js-webform-unsaved :input:not(:button, :submit, :reset)', context).once('webform-unsaved').on('change keypress', function (event, param1) {
|
||||
// Ignore events triggered when #states API is changed,
|
||||
// which passes 'webform.states' as param1.
|
||||
// @see webform.states.js ::triggerEventHandlers().
|
||||
if (param1 !== 'webform.states') {
|
||||
unsaved = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.js-webform-unsaved button, .js-webform-unsaved input[type=\'submit\']', context).once('webform-unsaved').on('click', function () {
|
||||
$('.js-webform-unsaved button, .js-webform-unsaved input[type="submit"]', context).once('webform-unsaved').on('click', function (event) {
|
||||
// For reset button we must confirm unsaved changes before the
|
||||
// before unload event handler.
|
||||
if ($(this).hasClass('webform-button--reset') && unsaved) {
|
||||
if (!window.confirm(Drupal.t('Changes you made may not be saved.') + '\n\n' + Drupal.t('Press OK to leave this page or Cancel to stay.'))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
unsaved = false;
|
||||
});
|
||||
|
||||
// Track all CKEditor change events.
|
||||
// @see https://ckeditor.com/old/forums/Support/CKEditor-jQuery-change-event
|
||||
if (window.CKEDITOR && !CKEDITOR.webformUnsaved) {
|
||||
CKEDITOR.webformUnsaved = true;
|
||||
CKEDITOR.on('instanceCreated', function (event) {
|
||||
event.editor.on('change', function (evt) {
|
||||
unsaved = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -43,7 +67,7 @@
|
|||
}
|
||||
});
|
||||
|
||||
/*!
|
||||
/**
|
||||
* An experimental shim to partially emulate onBeforeUnload on iOS.
|
||||
* Part of https://github.com/codedance/jquery.AreYouSure/
|
||||
*
|
||||
|
@ -60,9 +84,9 @@
|
|||
}
|
||||
$('a').bind('click', function (evt) {
|
||||
var href = $(evt.target).closest('a').attr('href');
|
||||
if (href !== undefined && !(href.match(/^#/) || href.trim() == '')) {
|
||||
if (typeof href !== 'undefined' && !(href.match(/^#/) || href.trim() === '')) {
|
||||
if ($(window).triggerHandler('beforeunload')) {
|
||||
if (!confirm(Drupal.t('Changes you made may not be saved.') + '\n\n' + Drupal.t('Press OK to leave this page or Cancel to stay.'))) {
|
||||
if (!window.confirm(Drupal.t('Changes you made may not be saved.') + '\n\n' + Drupal.t('Press OK to leave this page or Cancel to stay.'))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue