honkster-jelly 0.8.11 → 0.8.12
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 +23 -18
- 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.8.
|
5
|
+
* version 0.8.12
|
6
6
|
*
|
7
7
|
* Copyright (c) 2009 Pivotal Labs
|
8
8
|
* Licensed under the MIT license.
|
@@ -62,41 +62,46 @@ $.extend(Jelly, {
|
|
62
62
|
}
|
63
63
|
},
|
64
64
|
|
65
|
-
notify: function(
|
65
|
+
notify: function(instructions) {
|
66
66
|
if (this == Jelly) {
|
67
67
|
return Jelly.Observers.notify.apply(this.observers, arguments);
|
68
68
|
}
|
69
|
-
if (!$.isArray(
|
70
|
-
|
69
|
+
if (!$.isArray(instructions)) {
|
70
|
+
instructions = [instructions];
|
71
71
|
}
|
72
72
|
|
73
73
|
var pristineObservers = this.slice(0);
|
74
74
|
var observers;
|
75
|
-
for (var i = 0; i <
|
76
|
-
var
|
75
|
+
for (var i = 0; i < instructions.length; i++) {
|
76
|
+
var instruction = instructions[i];
|
77
77
|
|
78
78
|
// Deprecate 'on' in favor of making each page action a Component.
|
79
|
-
if (
|
80
|
-
observers = [eval(
|
79
|
+
if (instruction.on) {
|
80
|
+
observers = [eval(instruction.on)];
|
81
81
|
} else {
|
82
82
|
observers = pristineObservers;
|
83
83
|
}
|
84
84
|
|
85
|
-
if (
|
85
|
+
if (instruction.method) {
|
86
86
|
for (var j = 0; j < observers.length; j++) {
|
87
87
|
var observer = observers[j];
|
88
|
-
|
89
|
-
|
90
|
-
Jelly.Observers.garbageCollectObserver.call(this, observer);
|
91
|
-
} else {
|
92
|
-
observer[callback.method].apply(observer, callback.arguments);
|
93
|
-
}
|
94
|
-
}
|
88
|
+
Jelly.Observers.notifyObserver.call(this, observer, instruction.method, instruction.arguments);
|
89
|
+
Jelly.Observers.notifyObserver.call(this, observer, 'on_notify', [instruction]);
|
95
90
|
}
|
96
91
|
}
|
97
92
|
|
98
|
-
if (
|
99
|
-
Jelly.Observers.attach.apply(this,
|
93
|
+
if (instruction.attach) {
|
94
|
+
Jelly.Observers.attach.apply(this, instruction.attach);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
},
|
98
|
+
|
99
|
+
notifyObserver: function(observer, method, arguments) {
|
100
|
+
if (observer[method]) {
|
101
|
+
if (observer.detach && observer.detach()) {
|
102
|
+
Jelly.Observers.garbageCollectObserver.call(this, observer);
|
103
|
+
} else {
|
104
|
+
observer[method].apply(observer, arguments);
|
100
105
|
}
|
101
106
|
}
|
102
107
|
},
|
data/jelly.gemspec
CHANGED