mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
refactor(listeners) pop
This commit is contained in:
parent
cad88ad229
commit
ce31430f52
1 changed files with 9 additions and 8 deletions
|
|
@ -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
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue