aea72d47 by Michael Richards

Use the @bindingRegExp function directly from inside @build.

1 parent da922b4e
......@@ -83,9 +83,8 @@
};
View.prototype.build = function() {
var attribute, bindingRegExp, context, keypath, node, path, pipes, type, _i, _len, _ref, _results;
var attribute, context, keypath, node, path, pipes, type, _i, _len, _ref, _results;
this.bindings = [];
bindingRegExp = this.bindingRegExp();
_ref = this.el.getElementsByTagName('*');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
......@@ -96,8 +95,8 @@
_results1 = [];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
attribute = _ref1[_j];
if (bindingRegExp.test(attribute.name)) {
type = attribute.name.replace(bindingRegExp, '');
if (this.bindingRegExp().test(attribute.name)) {
type = attribute.name.replace(this.bindingRegExp(), '');
pipes = attribute.value.split('|').map(function(pipe) {
return pipe.trim();
});
......
......@@ -51,12 +51,10 @@ class Rivets.View
build: =>
@bindings = []
bindingRegExp = @bindingRegExp()
for node in @el.getElementsByTagName '*'
for attribute in node.attributes
if bindingRegExp.test attribute.name
type = attribute.name.replace bindingRegExp, ''
if @bindingRegExp().test attribute.name
type = attribute.name.replace @bindingRegExp(), ''
pipes = attribute.value.split('|').map (pipe) -> pipe.trim()
path = pipes.shift().split '.'
context = @contexts[path.shift()]
......