honkster-jelly 0.7.2 → 0.7.3
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 +19 -2
- data/jelly.gemspec +1 -1
- 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.7.
|
5
|
+
* version 0.7.3
|
6
6
|
*
|
7
7
|
* Copyright (c) 2009 Pivotal Labs
|
8
8
|
* Licensed under the MIT license.
|
@@ -66,11 +66,28 @@ Jelly.notifyObservers = function(params, observers) {
|
|
66
66
|
for (var i = 0; i < observers.length; i++) {
|
67
67
|
var observer = observers[i];
|
68
68
|
if (observer[params.method]) {
|
69
|
-
observer
|
69
|
+
if (observer.detach && observer.detach()) {
|
70
|
+
this.garbageCollectObserver(observer);
|
71
|
+
} else {
|
72
|
+
observer[params.method].apply(observer, params.arguments);
|
73
|
+
}
|
70
74
|
}
|
71
75
|
}
|
72
76
|
};
|
73
77
|
|
78
|
+
Jelly.garbageCollectObserver = function(observer) {
|
79
|
+
var index = Jelly.observers.indexOf(observer);
|
80
|
+
if (index > -1) {
|
81
|
+
this.arrayRemove(Jelly.observers, index, index + 1);
|
82
|
+
}
|
83
|
+
};
|
84
|
+
|
85
|
+
Jelly.arrayRemove = function(array, from, to) {
|
86
|
+
var rest = array.slice((to || from) + 1 || array.length);
|
87
|
+
array.length = from < 0 ? array.length + from : from;
|
88
|
+
return array.push.apply(array, rest);
|
89
|
+
};
|
90
|
+
|
74
91
|
Jelly.Components = {
|
75
92
|
init: function() {
|
76
93
|
for (var i = 0; i < Jelly.components.length; i++) {
|
data/jelly.gemspec
CHANGED