mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
add fireEvent method to component API
This commit is contained in:
@@ -250,6 +250,7 @@ license that can be found in the LICENSE file.
|
||||
// probably better to insert another link in the prototype chain
|
||||
p.utils = utils;
|
||||
p.setPropertySilently = setPropertySilently;
|
||||
p.fireEvent = fireEvent;
|
||||
// install our prototype
|
||||
this.generatedConstructor.prototype = p;
|
||||
};
|
||||
@@ -290,6 +291,11 @@ license that can be found in the LICENSE file.
|
||||
}
|
||||
};
|
||||
|
||||
var fireEvent = function(inType, inDetail) {
|
||||
return this.dispatchEvent(new CustomEvent(inType,
|
||||
{bubbles: true, detail: inDetail}));
|
||||
};
|
||||
|
||||
// collect utils
|
||||
|
||||
var utils = {
|
||||
|
||||
Reference in New Issue
Block a user