e7a734d3 by Michael Richards

Set up dependency observers in Rivets.Binding::bind() that recompute the value a…

…t the original keypath.
1 parent 25e88c63
...@@ -63,6 +63,14 @@ class Rivets.Binding ...@@ -63,6 +63,14 @@ class Rivets.Binding
63 if Rivets.config.preloadData 63 if Rivets.config.preloadData
64 @set Rivets.config.adapter.read @model, @keypath 64 @set Rivets.config.adapter.read @model, @keypath
65 65
66 if @options.dependencies?.length
67 for keypath in @options.dependencies
68 Rivets.config.adapter.subscribe @model, keypath, (stub) =>
69 @set if @options.bypass
70 @model[@keypath]
71 else
72 Rivets.config.adapter.read @model, @keypath
73
66 if @type in @bidirectionals 74 if @type in @bidirectionals
67 bindEvent @el, 'change', @publish 75 bindEvent @el, 'change', @publish
68 76
......