Skip to content
This repository has been archived by the owner on Sep 20, 2018. It is now read-only.

Commit

Permalink
[added] trigger() to element collection
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Dec 21, 2015
1 parent 784f1ab commit 244d6fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ Object.assign(eQuery.fn, {

return key && state ? state[key] : state
},

trigger(event, ...args) {
if (event.indexOf('on') !== 0)
event = 'on' + event[0].toUpperCase() + event.substr(1)

return this.each(component => {
component.props[event]
&& component.props[event](...args)

this._root && this._root.update()
});
}

})
Expand Down

0 comments on commit 244d6fb

Please sign in to comment.