6ad92e53 by Adam Heath

No longer tokenize keypath at all; the adapter does it. This allows for

foo.bar.baz.one.two.three type access, and, even possibly supporting
xpath or xql type access, if a suitablly sophisticated adapter is
written.
1 parent 7327fc5e
......@@ -180,7 +180,11 @@ defaultExpressionParser = (view, node, type, models, value) ->
formatters: pipes
bypass: path.indexOf(':') != -1
bindContext: models
firstPart = splitPath.shift()
parsingSupport = Rivets.config.adapter.parsingSupport
firstPart = if parsingSupport
splitPath[0]
else
splitPath.shift()
model = if firstPart
Rivets.config.adapter.read models, firstPart
else
......@@ -191,7 +195,7 @@ defaultExpressionParser = (view, node, type, models, value) ->
if dependencies = context.shift()
options.dependencies = dependencies.split /\s+/
binding = new Rivets.Binding node, type, model, keypath, options
binding = new Rivets.Binding node, type, (if parsingSupport then models else model), keypath, options
binding.view = view
binding
......