Commit f1279992 authored by alexpott's avatar alexpott

Issue #2723557 by droplet: [Follow up] Drupal.ajax.expired tweaks

parent 84e06064
......@@ -1203,18 +1203,21 @@
var ajaxSettings = drupalSettings.ajax;
// Clean up drupalSettings.ajax.
Drupal.ajax.expired().forEach(function (instance) {
// If the Ajax object has been created through drupalSettings.ajax
// it will have a selector. When there is no selector the object
// has been initialized with a special class name picked up by the
// Ajax behavior.
if (instance.selector) {
var selector = instance.selector.replace('#', '');
if (ajaxSettings && selector in ajaxSettings) {
delete ajaxSettings[selector];
if (ajaxSettings) {
Drupal.ajax.expired().forEach(function (instance) {
// If the Ajax object has been created through drupalSettings.ajax
// it will have a selector. When there is no selector the object
// has been initialized with a special class name picked up by the
// Ajax behavior.
if (instance.selector) {
var selector = instance.selector.replace('#', '');
if (selector in ajaxSettings) {
delete ajaxSettings[selector];
}
}
}
});
});
}
if (response.merge) {
$.extend(true, drupalSettings, response.settings);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment