Load subpages

This commit is contained in:
Ruud
2014-05-13 22:37:00 +02:00
parent 43b6e3ac07
commit d80fe99609
5 changed files with 49 additions and 10 deletions
+6 -6
View File
@@ -1,4 +1,4 @@
var CouchPotato = new Class({
var CouchPotato = new Class({
Implements: [Events, Options],
@@ -152,7 +152,7 @@ var CouchPotato = new Class({
pages.stableSort(self.sortPageByOrder).each(function(page){
page['class'].load();
self.fireEvent('load'+page.name);
$(page['class']).inject(self.content);
$(page['class']).inject(self.pages);
});
delete pages;
@@ -169,11 +169,11 @@ var CouchPotato = new Class({
var self = this;
self.route.parse();
var page_name = self.route.getPage().capitalize();
var action = self.route.getAction();
var params = self.route.getParams();
var page_name = self.route.getPage().capitalize(),
action = self.route.getAction(),
params = self.route.getParams(),
current_url = self.route.getCurrentUrl();
var current_url = self.route.getCurrentUrl();
if(current_url == self.current_url)
return;