From 65a48ca731f25d46cf1d59c858292016d407d755 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 22 May 2014 09:15:08 -0400 Subject: [PATCH] refactor(listeners) pop --- lib/client/listeners.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/client/listeners.js b/lib/client/listeners.js index 190939ce..7c9dd231 100644 --- a/lib/client/listeners.js +++ b/lib/client/listeners.js @@ -387,16 +387,14 @@ var Util, DOM, CloudCmd; function pop() { Events.add('popstate', function(event) { - var path; + var path = event.state; - if (!event.state) - CloudCmd.route(location.hash); - else { - path = event.state + '?json'; + if (path) CloudCmd.ajaxLoad(path, { nohistory: true }); - } + else + CloudCmd.route(location.hash); }); }