From 1a6a72591fc57a71e675062d8906b9c4095dbb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=93=E3=81=B4=E3=81=AA=E3=81=9F=E3=81=BF=E3=81=BD?= Date: Wed, 7 Feb 2018 18:21:37 +0900 Subject: [PATCH] wip --- src/web/app/common/tags/post-menu.tag | 6 +-- src/web/app/common/tags/reaction-picker.vue | 51 +++++++------------ src/web/app/desktop/tags/contextmenu.tag | 2 +- .../app/desktop/tags/detailed-post-window.tag | 2 +- src/web/app/desktop/tags/dialog.tag | 2 +- src/web/app/desktop/tags/donation.tag | 2 +- .../desktop/tags/drive/base-contextmenu.tag | 2 +- .../app/desktop/tags/drive/browser-window.tag | 2 +- .../desktop/tags/drive/file-contextmenu.tag | 2 +- .../desktop/tags/drive/folder-contextmenu.tag | 2 +- .../app/desktop/tags/following-setuper.tag | 2 +- src/web/app/desktop/tags/images.tag | 2 +- src/web/app/desktop/tags/input-dialog.tag | 2 +- .../desktop/tags/messaging/room-window.tag | 2 +- src/web/app/desktop/tags/messaging/window.tag | 2 +- src/web/app/desktop/tags/post-form-window.tag | 2 +- src/web/app/desktop/tags/progress-dialog.tag | 2 +- .../app/desktop/tags/repost-form-window.tag | 2 +- .../tags/select-file-from-drive-window.tag | 2 +- .../tags/select-folder-from-drive-window.tag | 2 +- .../desktop/tags/set-avatar-suggestion.tag | 2 +- .../desktop/tags/set-banner-suggestion.tag | 2 +- src/web/app/desktop/tags/settings-window.tag | 2 +- src/web/app/desktop/tags/ui.tag | 2 +- src/web/app/desktop/tags/user-preview.tag | 2 +- .../app/mobile/tags/drive-folder-selector.tag | 4 +- src/web/app/mobile/tags/drive-selector.tag | 6 +-- src/web/app/mobile/tags/init-following.tag | 2 +- src/web/app/mobile/tags/notify.tag | 2 +- src/web/app/mobile/tags/post-form.tag | 4 +- 30 files changed, 54 insertions(+), 67 deletions(-) diff --git a/src/web/app/common/tags/post-menu.tag b/src/web/app/common/tags/post-menu.tag index 92b2801f59..2ca8c9602f 100644 --- a/src/web/app/common/tags/post-menu.tag +++ b/src/web/app/common/tags/post-menu.tag @@ -119,7 +119,7 @@ post_id: this.post.id }).then(() => { if (this.opts.cb) this.opts.cb('pinned', '%i18n:common.tags.mk-post-menu.pinned%'); - this.unmount(); + this.$destroy(); }); }; @@ -130,7 +130,7 @@ category: category }).then(() => { if (this.opts.cb) this.opts.cb('categorized', '%i18n:common.tags.mk-post-menu.categorized%'); - this.unmount(); + this.$destroy(); }); }; @@ -150,7 +150,7 @@ scale: 0.5, duration: 200, easing: 'easeInBack', - complete: () => this.unmount() + complete: () => this.$destroy() }); }; diff --git a/src/web/app/common/tags/reaction-picker.vue b/src/web/app/common/tags/reaction-picker.vue index 4157372088..496144d886 100644 --- a/src/web/app/common/tags/reaction-picker.vue +++ b/src/web/app/common/tags/reaction-picker.vue @@ -74,41 +74,28 @@ }, onMouseout: function(e) { this.title = placeholder; + }, + close: function() { + this.$refs.backdrop.style.pointerEvents = 'none'; + anime({ + targets: this.$refs.backdrop, + opacity: 0, + duration: 200, + easing: 'linear' + }); + + this.$refs.popover.style.pointerEvents = 'none'; + anime({ + targets: this.$refs.popover, + opacity: 0, + scale: 0.5, + duration: 200, + easing: 'easeInBack', + complete: () => this.$destroy() + }); } } }; - - this.mixin('api'); - - this.post = this.opts.post; - this.source = this.opts.source; - - this.on('mount', () => { - }); - - this.react = reaction => { - - }; - - this.close = () => { - this.$refs.backdrop.style.pointerEvents = 'none'; - anime({ - targets: this.$refs.backdrop, - opacity: 0, - duration: 200, - easing: 'linear' - }); - - this.$refs.popover.style.pointerEvents = 'none'; - anime({ - targets: this.$refs.popover, - opacity: 0, - scale: 0.5, - duration: 200, - easing: 'easeInBack', - complete: () => this.unmount() - }); - }; diff --git a/src/web/app/desktop/tags/contextmenu.tag b/src/web/app/desktop/tags/contextmenu.tag index 2a3b2a7726..ade44fce25 100644 --- a/src/web/app/desktop/tags/contextmenu.tag +++ b/src/web/app/desktop/tags/contextmenu.tag @@ -132,7 +132,7 @@ }); this.trigger('closed'); - this.unmount(); + this.$destroy(); }; diff --git a/src/web/app/desktop/tags/detailed-post-window.tag b/src/web/app/desktop/tags/detailed-post-window.tag index 93df377c4f..6d6f23ac35 100644 --- a/src/web/app/desktop/tags/detailed-post-window.tag +++ b/src/web/app/desktop/tags/detailed-post-window.tag @@ -69,7 +69,7 @@ opacity: 0, duration: 300, easing: 'linear', - complete: () => this.unmount() + complete: () => this.$destroy() }); }; diff --git a/src/web/app/desktop/tags/dialog.tag b/src/web/app/desktop/tags/dialog.tag index 9299e97334..aff855251e 100644 --- a/src/web/app/desktop/tags/dialog.tag +++ b/src/web/app/desktop/tags/dialog.tag @@ -130,7 +130,7 @@ scale: 0.8, duration: 300, easing: [ 0.5, -0.5, 1, 0.5 ], - complete: () => this.unmount() + complete: () => this.$destroy() }); }; diff --git a/src/web/app/desktop/tags/donation.tag b/src/web/app/desktop/tags/donation.tag index b2d18d4450..73ee9d0032 100644 --- a/src/web/app/desktop/tags/donation.tag +++ b/src/web/app/desktop/tags/donation.tag @@ -60,7 +60,7 @@ show_donation: false }); - this.unmount(); + this.$destroy(); }; diff --git a/src/web/app/desktop/tags/drive/base-contextmenu.tag b/src/web/app/desktop/tags/drive/base-contextmenu.tag index eb97ccccc1..d2381cc471 100644 --- a/src/web/app/desktop/tags/drive/base-contextmenu.tag +++ b/src/web/app/desktop/tags/drive/base-contextmenu.tag @@ -18,7 +18,7 @@ this.on('mount', () => { this.$refs.ctx.on('closed', () => { this.trigger('closed'); - this.unmount(); + this.$destroy(); }); }); diff --git a/src/web/app/desktop/tags/drive/browser-window.tag b/src/web/app/desktop/tags/drive/browser-window.tag index 01cb4b1af8..f49921eb65 100644 --- a/src/web/app/desktop/tags/drive/browser-window.tag +++ b/src/web/app/desktop/tags/drive/browser-window.tag @@ -43,7 +43,7 @@ this.on('mount', () => { this.$refs.window.on('closed', () => { - this.unmount(); + this.$destroy(); }); this.api('drive').then(info => { diff --git a/src/web/app/desktop/tags/drive/file-contextmenu.tag b/src/web/app/desktop/tags/drive/file-contextmenu.tag index 25721372b7..bb934d35e5 100644 --- a/src/web/app/desktop/tags/drive/file-contextmenu.tag +++ b/src/web/app/desktop/tags/drive/file-contextmenu.tag @@ -50,7 +50,7 @@ this.on('mount', () => { this.$refs.ctx.on('closed', () => { this.trigger('closed'); - this.unmount(); + this.$destroy(); }); }); diff --git a/src/web/app/desktop/tags/drive/folder-contextmenu.tag b/src/web/app/desktop/tags/drive/folder-contextmenu.tag index d424482faa..43cad3da55 100644 --- a/src/web/app/desktop/tags/drive/folder-contextmenu.tag +++ b/src/web/app/desktop/tags/drive/folder-contextmenu.tag @@ -30,7 +30,7 @@ this.$refs.ctx.on('closed', () => { this.trigger('closed'); - this.unmount(); + this.$destroy(); }); }; diff --git a/src/web/app/desktop/tags/following-setuper.tag b/src/web/app/desktop/tags/following-setuper.tag index 8280986298..d8cd32a208 100644 --- a/src/web/app/desktop/tags/following-setuper.tag +++ b/src/web/app/desktop/tags/following-setuper.tag @@ -163,7 +163,7 @@ }; this.close = () => { - this.unmount(); + this.$destroy(); }; diff --git a/src/web/app/desktop/tags/images.tag b/src/web/app/desktop/tags/images.tag index dcd664e722..8c4234a0f6 100644 --- a/src/web/app/desktop/tags/images.tag +++ b/src/web/app/desktop/tags/images.tag @@ -165,7 +165,7 @@ opacity: 0, duration: 100, easing: 'linear', - complete: () => this.unmount() + complete: () => this.$destroy() }); }; diff --git a/src/web/app/desktop/tags/input-dialog.tag b/src/web/app/desktop/tags/input-dialog.tag index bea8c2c22b..1eef25db12 100644 --- a/src/web/app/desktop/tags/input-dialog.tag +++ b/src/web/app/desktop/tags/input-dialog.tag @@ -142,7 +142,7 @@ }); this.$refs.window.on('closed', () => { - this.unmount(); + this.$destroy(); }); }); diff --git a/src/web/app/desktop/tags/messaging/room-window.tag b/src/web/app/desktop/tags/messaging/room-window.tag index bae456200e..39afbe6ddd 100644 --- a/src/web/app/desktop/tags/messaging/room-window.tag +++ b/src/web/app/desktop/tags/messaging/room-window.tag @@ -25,7 +25,7 @@ this.on('mount', () => { this.$refs.window.on('closed', () => { - this.unmount(); + this.$destroy(); }); }); diff --git a/src/web/app/desktop/tags/messaging/window.tag b/src/web/app/desktop/tags/messaging/window.tag index afe01c53e1..cd756daa04 100644 --- a/src/web/app/desktop/tags/messaging/window.tag +++ b/src/web/app/desktop/tags/messaging/window.tag @@ -21,7 +21,7 @@ diff --git a/src/web/app/desktop/tags/set-banner-suggestion.tag b/src/web/app/desktop/tags/set-banner-suggestion.tag index cbf0f1b68f..c5c5c70190 100644 --- a/src/web/app/desktop/tags/set-banner-suggestion.tag +++ b/src/web/app/desktop/tags/set-banner-suggestion.tag @@ -42,7 +42,7 @@ this.close = e => { e.preventDefault(); e.stopPropagation(); - this.unmount(); + this.$destroy(); }; diff --git a/src/web/app/desktop/tags/settings-window.tag b/src/web/app/desktop/tags/settings-window.tag index e68a44a4f6..09566b898a 100644 --- a/src/web/app/desktop/tags/settings-window.tag +++ b/src/web/app/desktop/tags/settings-window.tag @@ -19,7 +19,7 @@ diff --git a/src/web/app/mobile/tags/drive-folder-selector.tag b/src/web/app/mobile/tags/drive-folder-selector.tag index 37d571d731..6a0cb5cea6 100644 --- a/src/web/app/mobile/tags/drive-folder-selector.tag +++ b/src/web/app/mobile/tags/drive-folder-selector.tag @@ -58,12 +58,12 @@ diff --git a/src/web/app/mobile/tags/drive-selector.tag b/src/web/app/mobile/tags/drive-selector.tag index ab67cc80c0..9e6f6a0457 100644 --- a/src/web/app/mobile/tags/drive-selector.tag +++ b/src/web/app/mobile/tags/drive-selector.tag @@ -71,18 +71,18 @@ this.$refs.browser.on('selected', file => { this.trigger('selected', file); - this.unmount(); + this.$destroy(); }); }); this.cancel = () => { this.trigger('canceled'); - this.unmount(); + this.$destroy(); }; this.ok = () => { this.trigger('selected', this.files); - this.unmount(); + this.$destroy(); }; diff --git a/src/web/app/mobile/tags/init-following.tag b/src/web/app/mobile/tags/init-following.tag index d2d19a8876..d7e31b460f 100644 --- a/src/web/app/mobile/tags/init-following.tag +++ b/src/web/app/mobile/tags/init-following.tag @@ -124,7 +124,7 @@ }; this.close = () => { - this.unmount(); + this.$destroy(); }; diff --git a/src/web/app/mobile/tags/notify.tag b/src/web/app/mobile/tags/notify.tag index 2dfc2dddb8..386166f7f6 100644 --- a/src/web/app/mobile/tags/notify.tag +++ b/src/web/app/mobile/tags/notify.tag @@ -32,7 +32,7 @@ bottom: '-64px', duration: 500, easing: 'easeOutQuad', - complete: () => this.unmount() + complete: () => this.$destroy() }); }, 6000); }); diff --git a/src/web/app/mobile/tags/post-form.tag b/src/web/app/mobile/tags/post-form.tag index 442919100d..6f07947536 100644 --- a/src/web/app/mobile/tags/post-form.tag +++ b/src/web/app/mobile/tags/post-form.tag @@ -255,7 +255,7 @@ poll: this.poll ? this.$refs.poll.get() : undefined }).then(data => { this.trigger('post'); - this.unmount(); + this.$destroy(); }).catch(err => { this.update({ wait: false @@ -265,7 +265,7 @@ this.cancel = () => { this.trigger('cancel'); - this.unmount(); + this.$destroy(); }; this.kao = () => {