Skip to content

Commit

Permalink
Hacky support for extra arg in 'trigger'. ES6 where are you?
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Aug 27, 2015
1 parent dbe36ec commit 02f827b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parsley/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ define('parsley/abstract', [
// Trigger an event of the given name.
// A return value of `false` interrupts the callback chain.
// Returns false if execution was interrupted.
trigger: function (name, target) {
trigger: function (name, target, extraArg) {
target = target || this;
var queue = this._listeners && this._listeners[name];
var result, parentResult;
if (queue) {
for(var i = queue.length; i--; ) {
result = queue[i].call(target, target);
result = queue[i].call(target, target, extraArg);
if (result === false) return result;
}
}
if (this.parent) {
return this.parent.trigger(name, target);
return this.parent.trigger(name, target, extraArg);
}
return true;
},
Expand Down

0 comments on commit 02f827b

Please sign in to comment.