summaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-05-09 16:14:12 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-05-09 16:14:12 +0900
commitf218425f697d9dc1b1181657ace074002cf56b64 (patch)
tree6590670317b3cd99a4211497ebec1ddce2b67361 /src/web
parent[Client] Fix bug (diff)
downloadmisskey-f218425f697d9dc1b1181657ace074002cf56b64.tar.gz
misskey-f218425f697d9dc1b1181657ace074002cf56b64.tar.bz2
misskey-f218425f697d9dc1b1181657ace074002cf56b64.zip
[Client] Improve usability
Diffstat (limited to 'src/web')
-rw-r--r--src/web/app/common/tags/twitter-setting.tag25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/web/app/common/tags/twitter-setting.tag b/src/web/app/common/tags/twitter-setting.tag
index 5160350456..ae4c054505 100644
--- a/src/web/app/common/tags/twitter-setting.tag
+++ b/src/web/app/common/tags/twitter-setting.tag
@@ -2,7 +2,7 @@
<p>%i18n:common.tags.mk-twitter-setting.description%<a href={ CONFIG.aboutUrl + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
<p class="account" if={ I.twitter } title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p>
<p>
- <a href={ CONFIG.apiUrl + '/connect/twitter' } target="_blank">{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a>
+ <a href={ CONFIG.apiUrl + '/connect/twitter' } target="_blank" onclick={ authorize }>{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a>
<span if={ I.twitter }> or </span>
<a href={ CONFIG.apiUrl + '/disconnect/twitter' } target="_blank" if={ I.twitter }>%i18n:common.tags.mk-twitter-setting.disconnect%</a>
</p>
@@ -26,5 +26,28 @@
</style>
<script>
this.mixin('i');
+
+ this.form = null;
+
+ this.on('mount', () => {
+ this.I.on('updated', this.onMeUpdated);
+ });
+
+ this.on('mount', () => {
+ this.I.off('updated', this.onMeUpdated);
+ });
+
+ this.onMeUpdated = () => {
+ if (this.I.twitter) {
+ if (this.form) this.form.close();
+ }
+ };
+
+ this.authorize = () => {
+ this.form = window.open(CONFIG.apiUrl + '/connect/twitter',
+ 'twitter_authorize_window',
+ 'height=570,width=520');
+ return false;
+ };
</script>
</mk-twitter-setting>