Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Bootstrap replaces the Drupal.Ajax.prototype.success method to deal with custom throbber, but then it should invoke the original handler using apply, not with a copy of the core code, because that may hide errors that have been fixed in core or misfunction for other changes in core code.
Here's where this happens:
https://git.drupalcode.org/project/bootstrap/-/blob/8.x-3.x/js/misc/ajax...
It shoud save the pointer of the original handler and be invked by call/apply after custom bootstrap code. ir. something like this:
var success = Drupal.Ajax.prototype.success;
Drupal.Ajax.prototype.success = function (response, status) {
if (this.progress.element) {
// Stop a glyphicon throbber.
if (this.progress.glyphicon) {
this.glyphiconStop(this.progress.element);
}
// Remove the progress element.
else {
this.progress.element.remove();
}
// Remove any message set.
this.progress.element.parent().find('.message').remove();
}
// Invoke original success handler.
return success.apply(this, [response, status]);
};
Comment | File | Size | Author |
---|---|---|---|
#2 | bootstrap-ajax-success-3144075-2.patch | 2.91 KB | markus_petrux |
Comments
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedI hope the explanation makes sense... patch attached.
Comment #5
markhalliwell