diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-18 16:42:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-18 16:42:41 +0900 |
| commit | 168b5bb723e9dd136ef33e958640778720a7827d (patch) | |
| tree | a2c6be5bb7eec83af02ac0e60ac7afff575d6ab7 /src/web/app/common/scripts | |
| parent | :v: (diff) | |
| download | misskey-168b5bb723e9dd136ef33e958640778720a7827d.tar.gz misskey-168b5bb723e9dd136ef33e958640778720a7827d.tar.bz2 misskey-168b5bb723e9dd136ef33e958640778720a7827d.zip | |
:v:
Diffstat (limited to 'src/web/app/common/scripts')
| -rw-r--r-- | src/web/app/common/scripts/i.js | 20 | ||||
| -rw-r--r-- | src/web/app/common/scripts/i.ls | 13 |
2 files changed, 20 insertions, 13 deletions
diff --git a/src/web/app/common/scripts/i.js b/src/web/app/common/scripts/i.js new file mode 100644 index 0000000000..66ce37d506 --- /dev/null +++ b/src/web/app/common/scripts/i.js @@ -0,0 +1,20 @@ +const riot = require('riot'); + +module.exports = me => { + riot.mixin('i', { + init: () => { + this.I = me; + this.SIGNIN = me != null; + + if (this.SIGNIN) { + this.on('mount', () => { + me.on('updated', this.update); + }); + this.on('unmount', () => { + me.off('updated', this.update); + }); + } + }, + me: me + }); +}; diff --git a/src/web/app/common/scripts/i.ls b/src/web/app/common/scripts/i.ls deleted file mode 100644 index 9b5fa87441..0000000000 --- a/src/web/app/common/scripts/i.ls +++ /dev/null @@ -1,13 +0,0 @@ -riot = require \riot - -module.exports = (me) -> - riot.mixin \i do - init: -> - @I = me - @SIGNIN = me? - - if @SIGNIN - @on \mount ~> me.on \updated @update - @on \unmount ~> me.off \updated @update - - me: me
\ No newline at end of file |