refactor(listeners) pop

This commit is contained in:
coderaiser 2014-02-14 10:31:27 -05:00
parent cad88ad229
commit ce31430f52

View file

@ -296,16 +296,17 @@ var Util, DOM, CloudCmd;
}
function pop() {
Events.add("popstate", function(pEvent) {
var lPath = pEvent.state + '?json';
Events.add("popstate", function(event) {
var path;
if (pEvent.state) {
lPath = pEvent.state + '?json';
CloudCmd.ajaxLoad(lPath, {nohistory: true});
} else
if (!event.state)
CloudCmd.route(location.hash);
return true;
else {
path = event.state + '?json';
CloudCmd.ajaxLoad(path, {
nohistory: true
});
}
});
}