wait for loadScript & widgets.render to emit action:ajaxify.end

v1.18.x
barisusakli 10 years ago
parent 96526a37a3
commit 3a36ae5c13

@ -150,13 +150,18 @@ $(document).ready(function() {
}
ajaxify.end = function(url, tpl_url) {
function done() {
if (--count === 0) {
$(window).trigger('action:ajaxify.end', {url: url});
}
}
var count = 2;
ajaxify.variables.parse();
ajaxify.loadScript(tpl_url);
ajaxify.loadScript(tpl_url, done);
ajaxify.widgets.render(tpl_url, url, function() {
$(window).trigger('action:ajaxify.end', {url: url});
});
ajaxify.widgets.render(tpl_url, url, done);
$(window).trigger('action:ajaxify.contentLoaded', {url: url, tpl: tpl_url});

@ -61,7 +61,10 @@ define('forum/groups/list', ['forum/infinitescroll'], function(infinitescroll) {
} else {
done();
}
$('[component="groups/container"]').attr('data-nextstart', data.nextStart);
if (data && data.nextStart) {
$('[component="groups/container"]').attr('data-nextstart', data.nextStart);
}
});
}

Loading…
Cancel
Save