d1af20dd by Michael Richards

Abandon brief underscore.js dependency.

1 parent 37ae641b
1 // Generated by CoffeeScript 1.3.1 1 // Generated by CoffeeScript 1.3.1
2 (function() { 2 (function() {
3 var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
3 4
4 window.rivets = (function() { 5 window.rivets = (function() {
5 var attr, bidirectionalBindings, bindableAttributes, bindings, getInputValue, registerBinding, setAttribute, _fn, _i, _len; 6 var attr, bidirectionalBindings, bindableAttributes, bindings, getInputValue, registerBinding, setAttribute, _fn, _i, _len;
...@@ -8,7 +9,7 @@ ...@@ -8,7 +9,7 @@
8 adapter.subscribe(context, keypath, function(value) { 9 adapter.subscribe(context, keypath, function(value) {
9 return bindings[type](el, value); 10 return bindings[type](el, value);
10 }); 11 });
11 if (_.include(bidirectionalBindings, type)) { 12 if (__indexOf.call(bidirectionalBindings, type) >= 0) {
12 return $(el).bind('change', function() { 13 return $(el).bind('change', function() {
13 return adapter.publish(context, keypath, getInputValue(this)); 14 return adapter.publish(context, keypath, getInputValue(this));
14 }); 15 });
...@@ -105,7 +106,7 @@ ...@@ -105,7 +106,7 @@
105 node = nodeMap[n]; 106 node = nodeMap[n];
106 if (/^data-/.test(node.name)) { 107 if (/^data-/.test(node.name)) {
107 type = node.name.replace('data-', ''); 108 type = node.name.replace('data-', '');
108 if (_.include(_.keys(bindings), type)) { 109 if (type in bindings) {
109 path = node.value.split('.'); 110 path = node.value.split('.');
110 context = path.shift(); 111 context = path.shift();
111 keypath = path.join('.'); 112 keypath = path.join('.');
......
...@@ -10,7 +10,7 @@ window.rivets = do -> ...@@ -10,7 +10,7 @@ window.rivets = do ->
10 adapter.subscribe context, keypath, (value) -> 10 adapter.subscribe context, keypath, (value) ->
11 bindings[type] el, value 11 bindings[type] el, value
12 12
13 if _.include bidirectionalBindings, type 13 if type in bidirectionalBindings
14 $(el).bind 'change', -> 14 $(el).bind 'change', ->
15 adapter.publish context, keypath, getInputValue(this) 15 adapter.publish context, keypath, getInputValue(this)
16 16
...@@ -67,7 +67,7 @@ window.rivets = do -> ...@@ -67,7 +67,7 @@ window.rivets = do ->
67 if /^data-/.test node.name 67 if /^data-/.test node.name
68 type = node.name.replace 'data-', '' 68 type = node.name.replace 'data-', ''
69 69
70 if _.include _.keys(bindings), type 70 if type of bindings
71 path = node.value.split '.' 71 path = node.value.split '.'
72 context = path.shift() 72 context = path.shift()
73 keypath = path.join '.' 73 keypath = path.join '.'
......