This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original CoffeScript gist can be found here: https://gist.github.com/2909552 (credits to the author) | |
// I just translated it to JavaScript for my own needs using Coffeescript to Javascript translator | |
_.extend(Backbone.Validation.callbacks, { | |
valid: function(view, attr, selector) { | |
var control, group; | |
control = view.$('[' + selector + '=' + attr + ']'); | |
group = control.parents(".control-group"); | |
group.removeClass("error"); | |
if (control.data("error-style") === "tooltip") { |