honkster-jelly 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/generators/jelly/templates/javascripts/jelly.js +14 -6
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Jelly. a sweet unobtrusive javascript framework
|
3
3
|
* for jQuery and Rails
|
4
4
|
*
|
5
|
-
* version 0.8.
|
5
|
+
* version 0.8.9
|
6
6
|
*
|
7
7
|
* Copyright (c) 2009 Pivotal Labs
|
8
8
|
* Licensed under the MIT license.
|
@@ -35,18 +35,20 @@ $.extend(Jelly, {
|
|
35
35
|
}
|
36
36
|
for (var i = 0; i < arguments.length; i++) {
|
37
37
|
var definitionOrComponent = arguments[i];
|
38
|
-
var observer;
|
39
38
|
if (definitionOrComponent.component) {
|
40
39
|
var component = Jelly.Observers.evaluateComponent(definitionOrComponent.component);
|
41
40
|
if (component.init) {
|
42
|
-
|
41
|
+
var initReturnValue = component.init.apply(component, definitionOrComponent.arguments);
|
42
|
+
if (initReturnValue === false || initReturnValue === null) {
|
43
|
+
} else {
|
44
|
+
Jelly.Observers.pushIfObserver.call(this, component.init.apply(component, definitionOrComponent.arguments) || component);
|
45
|
+
}
|
43
46
|
} else {
|
44
|
-
|
47
|
+
Jelly.Observers.pushIfObserver.call(this, component);
|
45
48
|
}
|
46
49
|
} else {
|
47
|
-
|
50
|
+
Jelly.Observers.pushIfObserver.call(this, Jelly.Observers.evaluateComponent(definitionOrComponent));
|
48
51
|
}
|
49
|
-
this.push(observer);
|
50
52
|
}
|
51
53
|
},
|
52
54
|
|
@@ -54,6 +56,12 @@ $.extend(Jelly, {
|
|
54
56
|
return (typeof component == "string") ? eval(component) : component;
|
55
57
|
},
|
56
58
|
|
59
|
+
pushIfObserver: function(observer) {
|
60
|
+
if (observer) {
|
61
|
+
this.push(observer);
|
62
|
+
}
|
63
|
+
},
|
64
|
+
|
57
65
|
notify: function(callbacks) {
|
58
66
|
if (this == Jelly) {
|
59
67
|
return Jelly.Observers.notify.apply(this.observers, arguments);
|