diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-18 17:29:27 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-18 17:29:27 +0900 |
| commit | 1817b3e6c3b8b2a450cc8624b04cf545ab992fab (patch) | |
| tree | 2938cae1cc360eb0711fcfa25cbdd39e0bb8951d /src | |
| parent | :v: (diff) | |
| download | sharkey-1817b3e6c3b8b2a450cc8624b04cf545ab992fab.tar.gz sharkey-1817b3e6c3b8b2a450cc8624b04cf545ab992fab.tar.bz2 sharkey-1817b3e6c3b8b2a450cc8624b04cf545ab992fab.zip | |
:v:
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/app/desktop/scripts/user-preview.js | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/web/app/desktop/scripts/user-preview.js b/src/web/app/desktop/scripts/user-preview.js index 8816eb41b3..8351f0e75a 100644 --- a/src/web/app/desktop/scripts/user-preview.js +++ b/src/web/app/desktop/scripts/user-preview.js @@ -2,16 +2,12 @@ const riot = require('riot'); riot.mixin('user-preview', { init: () => { - this.on('mount', () => { - scan.call(this); - }); - this.on('updated', () => { - scan.call(this); - }); - function scan(){ + const scan = () => { this.root.querySelectorAll('[data-user-preview]:not([data-user-preview-attached])') .forEach(attach.bind(this)); - } + }; + this.on('mount', scan); + this.on('updated', scan); } }); @@ -59,12 +55,12 @@ function attach(el) { tag = riot.mount(document.body.appendChild(preview), { user: user })[0]; - } + }; const close = () => { if (tag) { tag.close(); tag = null; } - } + }; } |