1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-17 21:18:27 +02:00

Fixed issue number 1298 component.trigger does not pass event object #1298

This commit is contained in:
Erick Acuna 2014-06-24 12:43:18 -04:00
parent 8a05aa11a1
commit 0ee79afdfe
2 changed files with 9 additions and 5 deletions

View File

@ -563,13 +563,15 @@ vjs.Component.prototype.one = function(type, fn) {
* Trigger an event on an element
*
* myComponent.trigger('eventName');
* myComponent.trigger({'type':'eventName', 'value':'eventValue'});
*
* @param {String} type The event type to trigger, e.g. 'click'
* @param {Event|Object} event The event object to be passed to the listener
* @param {Object} event either a string (the event type)
* to trigger or an event object
* with a type attribute.
* @return {vjs.Component} self
*/
vjs.Component.prototype.trigger = function(type, event){
vjs.trigger(this.el_, type, event);
vjs.Component.prototype.trigger = function(event){
vjs.trigger(this.el_, event);
return this;
};

View File

@ -265,7 +265,9 @@ vjs.fixEvent = function(event) {
/**
* Trigger an event for an element
* @param {Element|Object} elem Element to trigger an event on
* @param {String} event Type of event to trigger
* @param {Object} event either a string (the event type)
* to trigger or an event object with a
* type attribute.
* @private
*/
vjs.trigger = function(elem, event) {