bac6233c by Michael Richards

Move the formatters object outside of Rivets.config and expose it on the rivets module.

1 parent d6871d9c
......@@ -34,8 +34,8 @@ class Rivets.Binding
id = args.shift()
value = if @model[id] instanceof Function
@model[id] value, args...
else if Rivets.config.formatters[id]
Rivets.config.formatters[id] value, args...
else if Rivets.formatters[id]
Rivets.formatters[id] value, args...
value
......@@ -215,13 +215,18 @@ Rivets.routines =
# Default configuration.
Rivets.config =
preloadData: true
formatters: {}
# Default formatters. There aren't any.
Rivets.formatters = {}
# The rivets module. This is the public interface that gets exported.
rivets =
# Exposes the core binding routines that can be extended or stripped down.
routines: Rivets.routines
# Exposes the formatters object to be extended.
formatters: Rivets.formatters
# Exposes the rivets configuration options. These can be set manually or from
# rivets.configure with an object literal.
config: Rivets.config
......