cae03114 by Michael Richards

Fix @setModel logic so that @sync is called even on root-only keypaths.

1 parent 428746bd
...@@ -48,14 +48,15 @@ class Rivets.Binding ...@@ -48,14 +48,15 @@ class Rivets.Binding
48 48
49 model = current 49 model = current
50 50
51 if @key and @model and @model isnt model 51 if @model
52 @unbind true 52 if @model isnt model
53 @model = model 53 @unbind true if @key
54 @bind true 54 @model = model
55 @sync() 55 @bind true if @key
56 @sync()
56 else 57 else
57 @model = model 58 @model = model
58 59
59 # Applies all the current formatters to the supplied value and returns the 60 # Applies all the current formatters to the supplied value and returns the
60 # formatted value. 61 # formatted value.
61 formattedValue: (value) => 62 formattedValue: (value) =>
......