Skip to content

Node.js based forum software built for the modern web

animate page load only after widgets load

psychobunnyaea73298718f
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index fcd045c5d5..94eaba4fb6 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -122,14 +122,15 @@ var ajaxify = {};
socket.emit('widgets.render', {template: tpl_url + '.tpl', location: location}, function(err, renderedWidgets) {
area.html(templates.prepare(area.html()).parse({widgets: renderedWidgets})).removeClass('hidden');
+ next(err);
});
- });
-
- $('#content, #footer').stop(true, true).removeClass('ajaxifying');
- ajaxify.initialLoad = false;
+ }, function(err) {
+ $('#content, #footer').stop(true, true).removeClass('ajaxifying');
+ ajaxify.initialLoad = false;
- app.refreshTitle(url);
- $(window).trigger('action:ajaxify.end', { url: url });
+ app.refreshTitle(url);
+ $(window).trigger('action:ajaxify.end', { url: url });
+ });
});
}, url);