mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 06:41:24 +08:00
Refactored SiteMap/Header to support more dynamic flag counts
Also fixes deprecation in `plugin-outlet`
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
var _decorateId = 0;
|
||||
let _decorateId = 0;
|
||||
|
||||
function decorate(klass, evt, cb) {
|
||||
var mixin = {};
|
||||
const mixin = {};
|
||||
mixin["_decorate_" + (_decorateId++)] = function($elem) { cb($elem); }.on(evt);
|
||||
klass.reopen(mixin);
|
||||
}
|
||||
|
||||
export function decorateCooked(container, cb) {
|
||||
var postView = container.lookupFactory('view:post');
|
||||
const postView = container.lookupFactory('view:post');
|
||||
decorate(postView, 'postViewInserted', cb);
|
||||
decorate(postView, 'postViewUpdated', cb);
|
||||
decorate(container.lookupFactory('view:composer'), 'previewRefreshed', cb);
|
||||
|
Reference in New Issue
Block a user