d1af20dd by Michael Richards

Abandon brief underscore.js dependency.

1 parent 37ae641b
// Generated by CoffeeScript 1.3.1
(function() {
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; };
window.rivets = (function() {
var attr, bidirectionalBindings, bindableAttributes, bindings, getInputValue, registerBinding, setAttribute, _fn, _i, _len;
......@@ -8,7 +9,7 @@
adapter.subscribe(context, keypath, function(value) {
return bindings[type](el, value);
});
if (_.include(bidirectionalBindings, type)) {
if (__indexOf.call(bidirectionalBindings, type) >= 0) {
return $(el).bind('change', function() {
return adapter.publish(context, keypath, getInputValue(this));
});
......@@ -105,7 +106,7 @@
node = nodeMap[n];
if (/^data-/.test(node.name)) {
type = node.name.replace('data-', '');
if (_.include(_.keys(bindings), type)) {
if (type in bindings) {
path = node.value.split('.');
context = path.shift();
keypath = path.join('.');
......
......@@ -10,7 +10,7 @@ window.rivets = do ->
adapter.subscribe context, keypath, (value) ->
bindings[type] el, value
if _.include bidirectionalBindings, type
if type in bidirectionalBindings
$(el).bind 'change', ->
adapter.publish context, keypath, getInputValue(this)
......@@ -67,7 +67,7 @@ window.rivets = do ->
if /^data-/.test node.name
type = node.name.replace 'data-', ''
if _.include _.keys(bindings), type
if type of bindings
path = node.value.split '.'
context = path.shift()
keypath = path.join '.'
......