4f0e6416 by Philip Harrison

Stop relying on group split matching to keep separators

"string.path".split(/\./) should return: ["string", ".", "path"]

This is not the case in IE8.
IE returns:  ["string", "path"]

Instead do the split discarding the separators, get model and keypath
from this array. Check unsplit path  to se if the string has a bypass
separator to set the option flag.

This should probably be tested.
1 parent f3f69322
......@@ -72,7 +72,7 @@ class Rivets.Binding
@model[@keypath]
else
Rivets.config.adapter.read @model, @keypath
Rivets.config.adapter.subscribe @model, keypath, callback
if @type in @bidirectionals
......@@ -122,11 +122,12 @@ class Rivets.View
type = attribute.name.replace bindingRegExp, ''
pipes = (pipe.trim() for pipe in attribute.value.split '|')
context = (ctx.trim() for ctx in pipes.shift().split '>')
path = context.shift().split /(\.|:)/
path = context.shift()
splitPath = path.split /\.|:/
options.formatters = pipes
model = @models[path.shift()]
options.bypass = path.shift() is ':'
keypath = path.join()
model = @models[splitPath.shift()]
options.bypass = path.indexOf(":") != -1
keypath = splitPath.join()
if dependencies = context.shift()
options.dependencies = dependencies.split /\s+/
......@@ -244,4 +245,4 @@ rivets =
if module?
module.exports = rivets
else
@rivets = rivets
@rivets = rivets
\ No newline at end of file
......