Refactored SiteMap/Header to support more dynamic flag counts

Also fixes deprecation in `plugin-outlet`
This commit is contained in:
Robin Ward
2015-03-11 13:38:36 -04:00
parent dece5a351a
commit 7c9fb5d3fc
8 changed files with 98 additions and 89 deletions

View File

@ -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);