Skip to content

Commit

Permalink
Avoid bug of earlier jQuery where calling on('', ...)
Browse files Browse the repository at this point in the history
confuses the hell out of it. [#1092]
  • Loading branch information
marcandre committed Apr 15, 2016
1 parent 676ac2b commit 8248ad4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parsley/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,16 @@ ParsleyUI.Field = {

_actualizeTriggers: function () {
var $toBind = this._findRelated();
var trigger;

// Remove Parsley events already bound on this field
$toBind.off('.Parsley');
if (this._failedOnce)
$toBind.on(ParsleyUtils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), () => {
this.validate();
});
else {
$toBind.on(ParsleyUtils.namespaceEvents(this.options.trigger, 'Parsley'), event => {
else if (trigger = ParsleyUtils.namespaceEvents(this.options.trigger, 'Parsley')) {
$toBind.on(trigger, event => {
this._eventValidate(event);
});
}
Expand Down

0 comments on commit 8248ad4

Please sign in to comment.