Move the formatters object outside of Rivets.config and expose it on the rivets module.
Showing
1 changed file
with
8 additions
and
3 deletions
... | @@ -34,8 +34,8 @@ class Rivets.Binding | ... | @@ -34,8 +34,8 @@ class Rivets.Binding |
34 | id = args.shift() | 34 | id = args.shift() |
35 | value = if @model[id] instanceof Function | 35 | value = if @model[id] instanceof Function |
36 | @model[id] value, args... | 36 | @model[id] value, args... |
37 | else if Rivets.config.formatters[id] | 37 | else if Rivets.formatters[id] |
38 | Rivets.config.formatters[id] value, args... | 38 | Rivets.formatters[id] value, args... |
39 | 39 | ||
40 | value | 40 | value |
41 | 41 | ||
... | @@ -215,13 +215,18 @@ Rivets.routines = | ... | @@ -215,13 +215,18 @@ Rivets.routines = |
215 | # Default configuration. | 215 | # Default configuration. |
216 | Rivets.config = | 216 | Rivets.config = |
217 | preloadData: true | 217 | preloadData: true |
218 | formatters: {} | 218 | |
219 | # Default formatters. There aren't any. | ||
220 | Rivets.formatters = {} | ||
219 | 221 | ||
220 | # The rivets module. This is the public interface that gets exported. | 222 | # The rivets module. This is the public interface that gets exported. |
221 | rivets = | 223 | rivets = |
222 | # Exposes the core binding routines that can be extended or stripped down. | 224 | # Exposes the core binding routines that can be extended or stripped down. |
223 | routines: Rivets.routines | 225 | routines: Rivets.routines |
224 | 226 | ||
227 | # Exposes the formatters object to be extended. | ||
228 | formatters: Rivets.formatters | ||
229 | |||
225 | # Exposes the rivets configuration options. These can be set manually or from | 230 | # Exposes the rivets configuration options. These can be set manually or from |
226 | # rivets.configure with an object literal. | 231 | # rivets.configure with an object literal. |
227 | config: Rivets.config | 232 | config: Rivets.config | ... | ... |
-
Please register or sign in to post a comment