generators/jelly/templates/javascripts/jelly.js in honkster-jelly-0.8.12 vs generators/jelly/templates/javascripts/jelly.js in honkster-jelly-0.8.13
- old
+ new
@@ -1,10 +1,10 @@
/**
* Jelly. a sweet unobtrusive javascript framework
* for jQuery and Rails
*
- * version 0.8.12
+ * version 0.8.13
*
* Copyright (c) 2009 Pivotal Labs
* Licensed under the MIT license.
*
* * Date: 2009-07-20 9:50:50 (Mon, 20 Jul 2009)
@@ -64,10 +64,12 @@
notify: function(instructions) {
if (this == Jelly) {
return Jelly.Observers.notify.apply(this.observers, arguments);
}
+ var previousNotifying = Jelly.Observers.notifying;
+ Jelly.Observers.notifying = true;
if (!$.isArray(instructions)) {
instructions = [instructions];
}
var pristineObservers = this.slice(0);
@@ -92,10 +94,12 @@
if (instruction.attach) {
Jelly.Observers.attach.apply(this, instruction.attach);
}
}
+
+ Jelly.Observers.notifying = previousNotifying;
},
notifyObserver: function(observer, method, arguments) {
if (observer[method]) {
if (observer.detach && observer.detach()) {
@@ -103,9 +107,11 @@
} else {
observer[method].apply(observer, arguments);
}
}
},
+
+ notifying: false,
garbageCollectObserver: function(observer) {
var index = this.indexOf(observer);
if (index > -1) {
Jelly.Observers.remove.call(this, index, index + 1);