Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #374 from tzarger/master

Fix for ValidationEngine & hiding errors on change.
  • Loading branch information...
commit cb44a866495272169c4ba22d7c301d6ba2362bf9 2 parents 12d1170 + 039f6b5
@ivaynberg ivaynberg authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 select2.js
View
10 select2.js
@@ -568,7 +568,7 @@
this.body = thunk(function() { return opts.element.closest("body"); });
if (opts.element.attr("class") !== undefined) {
- this.container.addClass(opts.element.attr("class"));
+ this.container.addClass(opts.element.attr("class").replace(/validate\[[\S ]+] ?/, ''));
}
this.container.css(evaluate(opts.containerCss));
@@ -833,6 +833,11 @@
// some validation frameworks ignore the change event and listen instead to keyup, click for selects
// so here we trigger the click event manually
this.opts.element.click();
+
+ // ValidationEngine ignorea the change event and listens instead to blur
+ // so here we trigger the blur event manually if so desired
+ if (this.opts.blurOnChange)
+ this.opts.element.blur();
},
@@ -2379,7 +2384,8 @@
return markup.replace(/&/g, "&");
}
return markup;
- }
+ },
+ blurOnChange: false
};
// exports
Please sign in to comment.
Something went wrong with that request. Please try again.