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 CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 8
3
- :patch: 8
3
+ :patch: 9
4
4
  :major: 0
@@ -2,7 +2,7 @@
2
2
  * Jelly. a sweet unobtrusive javascript framework
3
3
  * for jQuery and Rails
4
4
  *
5
- * version 0.8.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
- observer = component.init.apply(component, definitionOrComponent.arguments) || component;
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
- observer = component;
47
+ Jelly.Observers.pushIfObserver.call(this, component);
45
48
  }
46
49
  } else {
47
- observer = Jelly.Observers.evaluateComponent(definitionOrComponent);
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);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honkster-jelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs, Inc