diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-03 05:22:25 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-03 05:22:25 +0900 |
| commit | 38b9fed379eee020820f3c070a00b107c6fb2721 (patch) | |
| tree | 62519ef6ac7fc5c331e2c917bcf7777b5e1c695c /src/web/app/common/scripts/api.ls | |
| parent | [Client] Refactor: Use JavaScript instead of LiveScript (diff) | |
| parent | Refactor (diff) | |
| download | sharkey-38b9fed379eee020820f3c070a00b107c6fb2721.tar.gz sharkey-38b9fed379eee020820f3c070a00b107c6fb2721.tar.bz2 sharkey-38b9fed379eee020820f3c070a00b107c6fb2721.zip | |
Merge branch 'master' of https://github.com/syuilo/misskey
Diffstat (limited to 'src/web/app/common/scripts/api.ls')
| -rw-r--r-- | src/web/app/common/scripts/api.ls | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/web/app/common/scripts/api.ls b/src/web/app/common/scripts/api.ls index 2292902a91..7ebd645db4 100644 --- a/src/web/app/common/scripts/api.ls +++ b/src/web/app/common/scripts/api.ls @@ -10,7 +10,11 @@ riot.mixin \net do module.exports = (i, endpoint, data) -> pending++ - + if pending == 1 + spinner := document.create-element \div + ..set-attribute \id \wait + document.body.append-child spinner + if i? and typeof i == \object then i = i.token body = [] @@ -36,11 +40,6 @@ module.exports = (i, endpoint, data) -> then endpoint else "#{CONFIG.api.url}/#{endpoint}" - if pending == 1 - spinner := document.create-element \div - ..set-attribute \id \wait - document.body.append-child spinner - new Promise (resolve, reject) -> timer = set-timeout -> net.trigger \detected-slow-network |