From 178bc82a559072a4499e67f672e8fe03f0b6910d Mon Sep 17 00:00:00 2001 From: psychobunny Date: Mon, 6 May 2013 20:23:38 +0000 Subject: [PATCH] removed deprecated functions from topics.js (server side parsing) and fixed the 150ms initial delay on first load --- public/src/ajaxify.js | 24 ++++++++++++------------ src/topics.js | 19 ------------------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index c4aea9a599..e58a50d8af 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -35,18 +35,18 @@ var ajaxify = {}; window.history.pushState({}, url, "/" + url); jQuery('#footer').fadeOut(100); - jQuery('#content').fadeOut(100, function() { - load_template(function() { - - exec_body_scripts(content); - - ajaxify.enable(); - if (callback) { - callback(); - } - - jQuery('#content, #footer').fadeIn(250); - }); + jQuery('#content').fadeOut(100); + + load_template(function() { + + exec_body_scripts(content); + + ajaxify.enable(); + if (callback) { + callback(); + } + + jQuery('#content, #footer').fadeIn(250); }); diff --git a/src/topics.js b/src/topics.js index 70a0dffe6a..85b04974c3 100644 --- a/src/topics.js +++ b/src/topics.js @@ -10,25 +10,6 @@ var RDB = require('./redis.js'), } - Topics.generate_topic_body = function(callback, tid, start, end) { - var topic_body = global.templates['topic']; - - posts.get(function(data) { - topic_body = topic_body.parse(data); - callback(topic_body); - }, tid, start, end); - }; - - // this needs to move into forum.js - Topics.generate_forum_body = function(callback, start, end) { - var forum_body = global.templates['home']; - - - Topics.get(function(data) { - forum_body = forum_body.parse(data); - callback(forum_body); - }, start, end); - }; Topics.get = function(callback, start, end) { if (start == null) start = 0;