Skip to content

Commit a2efd0d

Browse files
author
Andrew Mahon (Type/Code)
committed
making app more friendly for booklr/pushState
1 parent 4f4ee6a commit a2efd0d

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

lib/tc.app.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,40 @@ typecode-js v 0.1
2424

2525
o = $.extend({
2626
name:'',
27-
classes:{},
28-
features:[]
27+
page:{
28+
classes: {},
29+
features: []
30+
},
31+
inner_page: {
32+
classes: {},
33+
features: []
34+
}
2935
}, options);
3036

31-
this.features = o.features;
3237
this.classes = o.classes;
3338
this.events = $({});
3439
this.runtime = {};
3540

36-
if(o.features.length){
37-
for(i in o.features){
38-
if($.isFunction(o.features[i])){
39-
if(this.features[i](this) === false){
41+
this.initialize_features(o.page.features);
42+
this.initialize_features(o.inner_page.features);
43+
o.page.initialized = true;
44+
45+
this.events.trigger('app.featuresInitialized');
46+
}
47+
48+
App.prototype.initialize_features = function(features) {
49+
var i;
50+
51+
if(features.length){
52+
for(i in features){
53+
if($.isFunction(features[i])){
54+
if(features[i](this) === false){
4055
break;
4156
}
4257
}
4358
}
4459
}
45-
46-
this.events.trigger('app.featuresInitialized');
47-
}
60+
};
4861

4962
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
5063

0 commit comments

Comments
 (0)