Show wanted if no page is selected
This commit is contained in:
@@ -23,7 +23,11 @@ var CouchPotato = new Class({
|
|||||||
self.createPages();
|
self.createPages();
|
||||||
|
|
||||||
History.addEvent('change', self.openPage.bind(self));
|
History.addEvent('change', self.openPage.bind(self));
|
||||||
History.handleInitialState();
|
|
||||||
|
if(window.location.hash)
|
||||||
|
History.handleInitialState();
|
||||||
|
else
|
||||||
|
self.openPage(window.location.pathname);
|
||||||
|
|
||||||
self.c.addEvent('click:relay(a)', self.pushState.bind(self));
|
self.c.addEvent('click:relay(a)', self.pushState.bind(self));
|
||||||
},
|
},
|
||||||
@@ -77,9 +81,14 @@ var CouchPotato = new Class({
|
|||||||
if(self.current_page)
|
if(self.current_page)
|
||||||
self.current_page.hide()
|
self.current_page.hide()
|
||||||
|
|
||||||
var page = self.pages[page_name];
|
try {
|
||||||
page.open(action, params);
|
var page = self.pages[page_name] || self.pages.Wanted;
|
||||||
page.show();
|
page.open(action, params);
|
||||||
|
page.show();
|
||||||
|
}
|
||||||
|
catch(e){
|
||||||
|
p("Can't open page:" + url)
|
||||||
|
}
|
||||||
|
|
||||||
self.current_page = page;
|
self.current_page = page;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user