Skip to content
Snippets Groups Projects
Commit 96f3a696 authored by Simon Urli's avatar Simon Urli
Browse files

XWIKI-17403: Async observer does not take into account async element in subtree

  * Also check children of a mutated element to activate placeholder.
parent ae344cab
No related branches found
No related tags found
No related merge requests found
......@@ -110,10 +110,14 @@ require(["jquery", 'xwiki-meta'], function($, xm) {
for (var j = 0; j < mutation.addedNodes.length; j++) {
var element = mutation.addedNodes[j];
if (element.className == 'xwiki-async' && $(element).is(":visible")) {
activateAsyncPlaceHolder(element);
}
// we activate placeholder because they contain class xwiki-async and they are visible
var selector = ".xwiki-async:visible";
// placeholder can be in the subtree of the added/mutated element, so we use find()
// but it can also be the currently added/mutated element, so we use addBack()
$(element).find(selector).addBack(selector).each(function() {
activateAsyncPlaceHolder(this);
});
}
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment