Skip to content
Snippets Groups Projects
Commit 65decc25 authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Fixed IE / Edge bugs with ajaxStop.

parent 04a34518
Branches
Tags 7.x-2.3
1 merge request!2Issue #3342445: jQuery .live() is deprecated
......@@ -18,7 +18,6 @@
.find("a[href]" + settings.subselector)
.not('a[href*="javascript:"]')
.not('a[href^="#"]')
.not('a[target="_blank"]')
.not(".noLoadingAnimation")
.each(
function (i, element) {
......@@ -42,9 +41,9 @@
if (Drupal.settings.jquery_loadinganimation.show_on_form_submit) {
// Only execute if no other js events are registered to prevent cases
// where page is not being reloaded and layer does not close though.
$(context).find("form" + subselectorSuffix).not(".noLoadingAnimation").submit(function () {
$(context).find("form" + subselectorSuffix).submit(function () {
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.show();
$(context).ajaxStop(function () {
$(document).ajaxStop(function () {
// Hide loading animation after ALL ajax events have finished
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.hide();
});
......@@ -56,12 +55,12 @@
// Global context!
if (Drupal.settings.jquery_loadinganimation.show_on_ajax) {
// Register loading animations for ajax events!
$(context).ajaxStart(function () {
$(document).ajaxStart(function () {
// Show loading animation on request.
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.show();
});
$(context).ajaxStop(function () {
$(document).ajaxStop(function () {
// Hide loading animation after finish.
Drupal.behaviors.jquery_loadinganimation.Loadinganimation.hide();
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment