actually fixed isPopState error

v1.18.x
Julian Lam 10 years ago
parent d8c9ec0d40
commit e6701c5a1f

@ -60,11 +60,8 @@ $(document).ready(function() {
app.enterRoom('');
// If the url is in the cache, load from cache instead
if (cache.get(url)) { return true; }
else {
cache.url = ajaxify.currentPage;
ajaxify.isPopState = false;
}
if (cache.get(url, callback)) { return true; }
else { cache.url = ajaxify.currentPage; }
$(window).off('scroll');

@ -12,7 +12,7 @@ define('ajaxifyCache', function() {
Cache.DOM = $('#content > *').detach();
};
Cache.get = function(url) {
Cache.get = function(url, callback) {
if (url === Cache.url && ajaxify.isPopState) {
// Swap DOM elements
// setTimeout(function() {
@ -25,6 +25,8 @@ define('ajaxifyCache', function() {
Cache.url = ajaxify.currentPage;
ajaxify.currentPage = url;
if (typeof callback === 'function') { callback(); }
return true;
} else {
return false;

Loading…
Cancel
Save