FIX: decorate user stream should include element

In the past we would call the decorate function with no element
this made the extension on user stream pointless
This commit is contained in:
Sam 2018-05-07 09:50:56 +10:00
parent 71f74c0b28
commit 9c6cf9eb14
1 changed files with 6 additions and 1 deletions

View File

@ -723,7 +723,12 @@ export function withPluginApi(version, apiCodeCallback, opts) {
let _decorateId = 0; let _decorateId = 0;
function decorate(klass, evt, cb) { function decorate(klass, evt, cb) {
const mixin = {}; const mixin = {};
mixin["_decorate_" + (_decorateId++)] = function($elem) { cb($elem); }.on(evt); mixin["_decorate_" + (_decorateId++)] = function($elem) {
$elem = $elem || this.$();
if ($elem) {
cb($elem);
}
}.on(evt);
klass.reopen(mixin); klass.reopen(mixin);
} }