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(''); app.enterRoom('');
// If the url is in the cache, load from cache instead // If the url is in the cache, load from cache instead
if (cache.get(url)) { return true; } if (cache.get(url, callback)) { return true; }
else { else { cache.url = ajaxify.currentPage; }
cache.url = ajaxify.currentPage;
ajaxify.isPopState = false;
}
$(window).off('scroll'); $(window).off('scroll');

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

Loading…
Cancel
Save