fix(listeners) pop: event.state could be null

This commit is contained in:
coderaiser 2015-03-26 03:48:30 -04:00
parent d2c0afccab
commit c12cd62ce7

View file

@ -317,17 +317,17 @@ var Util, DOM, CloudFunc, CloudCmd;
function pop() {
Events.add('popstate', function(event) {
var path = event.state;
var path = event.state || '';
path = path.replace(CloudFunc.FS, '');
if (path)
if (!path)
CloudCmd.route(location.hash);
else
CloudCmd.loadDir({
path : path,
history : false
});
else
CloudCmd.route(location.hash);
});
}