mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 18:33:37 +08:00
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:
parent
71f74c0b28
commit
9c6cf9eb14
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user