From 5aa3dab2891328f6a05263d31343eea6a62f9cf5 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 4 May 2013 07:17:05 +0000 Subject: [PATCH] added popstate check to trigger ajaxify on back button keypress. forward button doesn't work yet --- public/src/ajaxify.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 36f4e233e8..bf80c175f2 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -20,6 +20,10 @@ var ajaxify = {}; }; + window.onpopstate = function(event) { + ajaxify.go(document.location.href.replace(rootUrl +'/', '')); + }; + ajaxify.go = function(url, callback) { // leave room and join global if (current_room != 'global') {