mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 16:30:34 +01:00
optimize ajaxify
- do not call $.timeago twice on topic load and for widgets - do not use toLocaleString for each timeago string, use a single Intl.DateTimeFormat instance instead - do not call format for empty timeago strings, ie a post that isnt edited doesnt have a timeago string - do not call isTouchDevice for every element - remove app.replaceSelfLinks, this is superceded with /me route - store references to jquery objects in navigator instead of creating them on every scroll
This commit is contained in:
@@ -202,15 +202,10 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
ajaxify.end = function (url, tpl_url) {
|
||||
var count = 2;
|
||||
function done() {
|
||||
count -= 1;
|
||||
if (count === 0) {
|
||||
$(window).trigger('action:ajaxify.end', { url: url, tpl_url: tpl_url, title: ajaxify.data.title });
|
||||
}
|
||||
}
|
||||
ajaxify.loadScript(tpl_url, done);
|
||||
ajaxify.widgets.render(tpl_url, done);
|
||||
ajaxify.loadScript(tpl_url, function done() {
|
||||
$(window).trigger('action:ajaxify.end', { url: url, tpl_url: tpl_url, title: ajaxify.data.title });
|
||||
});
|
||||
ajaxify.widgets.render(tpl_url);
|
||||
|
||||
$(window).trigger('action:ajaxify.contentLoaded', { url: url, tpl: tpl_url });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user