ed27a033 by Adam Heath

Use a jquery event namespace(rivets-error-bind) to stop listening for

all element events at once.
1 parent 20bc656b
......@@ -59,7 +59,7 @@ define(function(require) {
}
}
};
$(el).on('focus', holder.focus).on('blur', holder.blur);
$(el).on('focus.rivets-error-binder', holder.focus).on('blur.rivets-error-binder', holder.blur);
rivetsBinderCall(this, this.args[0], 'bind', arguments);
render(el, 'bind');
},
......@@ -67,7 +67,7 @@ define(function(require) {
var holder = this.validationHolder;
render(el, 'unbind');
$(this.validationHolder.marker).after(el).remove();
$(el).off('focus', holder.focus).off('blur', holder.blur);
$(el).off('.rivets-error-binder');
if (holder.observer.target) {
holder.observer.target.off('validated', holder.validated);
}
......