Skip to content

Commit db20ca3

Browse files
author
Andrew Mahon (x230)
committed
small changes for architizer
1 parent ee7c25d commit db20ca3

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

lib/App.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ define(['jquery', 'NIseed'], function($) {
2525
this.contexts = {};
2626

2727
this.invoke_feature_set(this.page._features);
28-
2928
this.page.add_feature = function() {
3029
self.invoke_feature.apply(self, arguments);
3130
};
31+
32+
this.get_state = function(){
33+
console.log('App.get_state');
34+
};
3235
};
3336

3437
App.prototype.invoke_feature = function(feature, callback) {
@@ -92,8 +95,8 @@ define(['jquery', 'NIseed'], function($) {
9295
var self = this, context_runtime;
9396
if(self.contexts[name]){
9497
for(context_runtime in self.contexts[name]){
95-
if($.isFunction(context_runtime.destroy)){
96-
context_runtime.destroy();
98+
if($.isFunction(self.contexts[name][context_runtime].destroy)){
99+
self.contexts[name][context_runtime].destroy();
97100
}
98101
}
99102
}

lib/Merlin2.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ define(['jquery', 'NIseed'], function($) {
115115
return false;
116116
}
117117

118+
// Provide Default Data
119+
if(!data){
120+
data = {
121+
122+
};
123+
}
124+
118125
// Special names
119126

120127
if ($.isFunction(name)) {
@@ -189,7 +196,6 @@ define(['jquery', 'NIseed'], function($) {
189196

190197
fn.update_controls();
191198

192-
193199
internal.n_step_renders += 1;
194200
if ($.isFunction(internal.current_step.visible)) {
195201
internal.current_step.visible.apply(internal.current_step, [self, data]);

lib/PushstateHelper.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ define(['jquery'], function($) {
2121
NI = window.NI;
2222

2323
function PushstateHelper(options) {
24-
24+
2525
var self = this, o, internal, fn, handlers;
26-
26+
2727
o = $.extend({
2828
app: null,
2929
use_hash: false
3030
}, options);
31-
31+
3232
internal = {
3333
name: 'mod.PushstateHelper'
3434
};
@@ -44,16 +44,9 @@ define(['jquery'], function($) {
4444
var i, path_components, position;
4545

4646
if(o.use_hash && href.hash){
47-
path_components = href.hash.split('/');
47+
path_components = PushstateHelper.get_path_components(href.hash);
4848
} else {
49-
path_components = href.pathname.split('/');
50-
}
51-
52-
position = path_components.length;
53-
while(position--){
54-
if(!path_components[position].length){
55-
path_components.splice(position,1);
56-
}
49+
path_components = PushstateHelper.get_path_components(href.pathname);
5750
}
5851

5952
// push the state change to Google Analytics
@@ -113,8 +106,17 @@ define(['jquery'], function($) {
113106
}
114107

115108
PushstateHelper.get_path_components = function(path){
116-
117-
}
109+
var components, position;
110+
components = [];
111+
components = path.split('/');
112+
position = components.length;
113+
while(position--){
114+
if(!components[position].length){
115+
components.splice(position,1);
116+
}
117+
}
118+
return components;
119+
};
118120

119121
NI.PushstateHelper = PushstateHelper;
120122

0 commit comments

Comments
 (0)