ca78db6c by Michael Richards

Merge branch 'model-formatter-precedence'

2 parents 2a04d617 08b5320f
...@@ -32,10 +32,10 @@ class Rivets.Binding ...@@ -32,10 +32,10 @@ class Rivets.Binding
32 for formatter in @formatters 32 for formatter in @formatters
33 args = formatter.split /\s+/ 33 args = formatter.split /\s+/
34 id = args.shift() 34 id = args.shift()
35 value = if Rivets.config.formatters && Rivets.config.formatters[id] 35 value = if @model[id] instanceof Function
36 Rivets.config.formatters[id] value, args...
37 else
38 @model[id] value, args... 36 @model[id] value, args...
37 else if Rivets.config.formatters[id]
38 Rivets.config.formatters[id] value, args...
39 39
40 value 40 value
41 41
...@@ -194,6 +194,7 @@ Rivets.routines = ...@@ -194,6 +194,7 @@ Rivets.routines =
194 # Default configuration. 194 # Default configuration.
195 Rivets.config = 195 Rivets.config =
196 preloadData: true 196 preloadData: true
197 formatters: {}
197 198
198 # The rivets module. This is the public interface that gets exported. 199 # The rivets module. This is the public interface that gets exported.
199 rivets = 200 rivets =
......