closes #2792, closes #2791, closes #2788, closes #2787, closes #2786, closes #2785, closes #2784, closes #2783

Squashed commit of the following:

commit ca5064a4effa3904ce936b521b169bba8d24f1a1
Author: Julian Lam <julian@designcreateplay.com>
Date:   Thu Feb 26 08:19:32 2015 -0500

    Revert "added ajaxify popstate cache, so back/forward will just put back the already loaded page"

    This reverts commit 77d154bb8b.

commit ae07fc56c156074de8048bb627f5d9be849c8ad1
Author: Julian Lam <julian@designcreateplay.com>
Date:   Thu Feb 26 08:19:24 2015 -0500

    Revert "on click, topics are marked read from the unread page. Also fixed an issue where isPopState kept getting set to true, causing issues"

    This reverts commit d8c9ec0d40.

    Conflicts:
    	public/src/client/unread.js

commit 96ee3631d7e4e1fc2c1b7632d86684fecd1e430f
Author: Julian Lam <julian@designcreateplay.com>
Date:   Thu Feb 26 08:18:25 2015 -0500

    Revert "actually fixed isPopState error"

    This reverts commit e6701c5a1f.
This commit is contained in:
Julian Lam
2015-02-26 08:19:57 -05:00
parent 0c8e0ca46f
commit 00f3084b8e
3 changed files with 9 additions and 68 deletions

View File

@@ -1,37 +0,0 @@
'use strict';
/* globals define, app, ajaxify */
define('ajaxifyCache', function() {
var Cache = {
url: undefined,
DOM: undefined,
tempDOM: undefined
};
Cache.set = function() {
Cache.DOM = $('#content > *').detach();
};
Cache.get = function(url, callback) {
if (url === Cache.url && ajaxify.isPopState) {
// Swap DOM elements
// setTimeout(function() {
Cache.tempDOM = $('#content > *').detach();
$('#content').append(Cache.DOM);
Cache.DOM = Cache.tempDOM;
// }, 100); // 100ms for realism! :sunglasses:
// Set the values that normally get set on ajaxify
Cache.url = ajaxify.currentPage;
ajaxify.currentPage = url;
if (typeof callback === 'function') { callback(); }
return true;
} else {
return false;
}
};
return Cache;
});