diff options
| author | rr- | 2016-06-17 20:25:44 +0200 |
|---|---|---|
| committer | rr- | 2016-06-18 10:35:20 +0200 |
| commit | a697aba1b071bf8a4b2d4c26fd92f2655b77bd03 (patch) | |
| tree | 4270eff4809a15ed1c9965730e53da3db5b7a897 /client/js/controls/post_edit_sidebar_control.js | |
| parent | 54e3099c5696e0b4fc7b05fb5ecc41ab4726628b (diff) | |
client/general: remove api calls from controls
Introduce some missing models along the way
Diffstat (limited to 'client/js/controls/post_edit_sidebar_control.js')
| -rw-r--r-- | client/js/controls/post_edit_sidebar_control.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index 798df58..e276237 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -1,22 +1,20 @@ 'use strict'; +const events = require('../events.js'); const views = require('../util/views.js'); -class PostEditSidebarControl { +const template = views.getTemplate('post-edit-sidebar'); + +class PostEditSidebarControl extends events.EventTarget { constructor(hostNode, post, postContentControl) { + super(); this._hostNode = hostNode; this._post = post; this._postContentControl = postContentControl; - this._template = views.getTemplate('post-edit-sidebar'); - - this.install(); - } - install() { - const sourceNode = this._template({ + views.replaceContent(this._hostNode, template({ post: this._post, - }); - views.replaceContent(this._hostNode, sourceNode); + })); } }; |