From 8ba4b17f467447aeaf8bca06488356fa28cdf621 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Sep 2018 21:53:04 +0900 Subject: [PATCH] :v: --- src/client/app/common/views/components/menu.vue | 2 +- src/client/app/common/views/components/note-menu.vue | 8 ++++---- .../app/common/views/components/reaction-picker.vue | 4 ++-- .../app/common/views/components/visibility-chooser.vue | 4 ++-- src/client/app/common/views/directives/autocomplete.ts | 2 +- .../app/desktop/views/components/context-menu.vue | 2 +- src/client/app/desktop/views/components/dialog.vue | 2 +- .../app/desktop/views/components/friends-maker.vue | 2 +- .../desktop/views/components/media-image-dialog.vue | 2 +- .../desktop/views/components/media-video-dialog.vue | 2 +- .../app/desktop/views/components/ui-notification.vue | 2 +- .../app/desktop/views/components/user-preview.vue | 2 +- src/client/app/desktop/views/components/window.vue | 4 ++-- src/client/app/init.ts | 10 +++++++--- src/client/app/mobile/views/components/dialog.vue | 2 +- .../app/mobile/views/components/drive-file-chooser.vue | 6 +++--- .../mobile/views/components/drive-folder-chooser.vue | 4 ++-- .../app/mobile/views/components/friends-maker.vue | 2 +- src/client/app/mobile/views/components/notify.vue | 2 +- .../app/mobile/views/components/post-form-dialog.vue | 2 +- 20 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/client/app/common/views/components/menu.vue b/src/client/app/common/views/components/menu.vue index e99bfcbd2..fba7e235e 100644 --- a/src/client/app/common/views/components/menu.vue +++ b/src/client/app/common/views/components/menu.vue @@ -108,7 +108,7 @@ export default Vue.extend({ easing: 'easeInBack', complete: () => { this.$emit('closed'); - this.$destroy(); + this.destroyDom(); } }); } diff --git a/src/client/app/common/views/components/note-menu.vue b/src/client/app/common/views/components/note-menu.vue index 0b0609ac4..c9912fb1e 100644 --- a/src/client/app/common/views/components/note-menu.vue +++ b/src/client/app/common/views/components/note-menu.vue @@ -64,7 +64,7 @@ export default Vue.extend({ (this as any).api('i/pin', { noteId: this.note.id }).then(() => { - this.$destroy(); + this.destroyDom(); }); }, @@ -73,7 +73,7 @@ export default Vue.extend({ (this as any).api('notes/delete', { noteId: this.note.id }).then(() => { - this.$destroy(); + this.destroyDom(); }); }, @@ -81,13 +81,13 @@ export default Vue.extend({ (this as any).api('notes/favorites/create', { noteId: this.note.id }).then(() => { - this.$destroy(); + this.destroyDom(); }); }, closed() { this.$nextTick(() => { - this.$destroy(); + this.destroyDom(); }); } } diff --git a/src/client/app/common/views/components/reaction-picker.vue b/src/client/app/common/views/components/reaction-picker.vue index a455afbf7..a4828c987 100644 --- a/src/client/app/common/views/components/reaction-picker.vue +++ b/src/client/app/common/views/components/reaction-picker.vue @@ -95,7 +95,7 @@ export default Vue.extend({ reaction: reaction }).then(() => { if (this.cb) this.cb(); - this.$destroy(); + this.destroyDom(); }); }, onMouseover(e) { @@ -120,7 +120,7 @@ export default Vue.extend({ scale: 0.5, duration: 200, easing: 'easeInBack', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); } } diff --git a/src/client/app/common/views/components/visibility-chooser.vue b/src/client/app/common/views/components/visibility-chooser.vue index 7d90b3520..1830b1832 100644 --- a/src/client/app/common/views/components/visibility-chooser.vue +++ b/src/client/app/common/views/components/visibility-chooser.vue @@ -101,7 +101,7 @@ export default Vue.extend({ this.$store.commit('device/setVisibility', visibility); } this.$emit('chosen', visibility); - this.$destroy(); + this.destroyDom(); }, close() { (this.$refs.backdrop as any).style.pointerEvents = 'none'; @@ -119,7 +119,7 @@ export default Vue.extend({ scale: 0.5, duration: 200, easing: 'easeInBack', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); } } diff --git a/src/client/app/common/views/directives/autocomplete.ts b/src/client/app/common/views/directives/autocomplete.ts index 26bc13871..f7f8e9bf1 100644 --- a/src/client/app/common/views/directives/autocomplete.ts +++ b/src/client/app/common/views/directives/autocomplete.ts @@ -167,7 +167,7 @@ class Autocomplete { private close() { if (this.suggestion == null) return; - this.suggestion.$destroy(); + this.suggestion.destroyDom(); this.suggestion = null; this.textarea.focus(); diff --git a/src/client/app/desktop/views/components/context-menu.vue b/src/client/app/desktop/views/components/context-menu.vue index afb6838eb..49aeac143 100644 --- a/src/client/app/desktop/views/components/context-menu.vue +++ b/src/client/app/desktop/views/components/context-menu.vue @@ -64,7 +64,7 @@ export default Vue.extend({ }); this.$emit('closed'); - this.$destroy(); + this.destroyDom(); } } }); diff --git a/src/client/app/desktop/views/components/dialog.vue b/src/client/app/desktop/views/components/dialog.vue index aff21c175..bbb1e0030 100644 --- a/src/client/app/desktop/views/components/dialog.vue +++ b/src/client/app/desktop/views/components/dialog.vue @@ -78,7 +78,7 @@ export default Vue.extend({ scale: 0.8, duration: 300, easing: [ 0.5, -0.5, 1, 0.5 ], - complete: () => this.$destroy() + complete: () => this.destroyDom() }); }, onBgClick() { diff --git a/src/client/app/desktop/views/components/friends-maker.vue b/src/client/app/desktop/views/components/friends-maker.vue index 7dfd9e435..4e8a212b0 100644 --- a/src/client/app/desktop/views/components/friends-maker.vue +++ b/src/client/app/desktop/views/components/friends-maker.vue @@ -14,7 +14,7 @@

%i18n:@empty%

%fa:spinner .pulse .fw%%i18n:@fetching%

%i18n:@refresh% - + diff --git a/src/client/app/desktop/views/components/media-image-dialog.vue b/src/client/app/desktop/views/components/media-image-dialog.vue index 026522d90..89a340d3a 100644 --- a/src/client/app/desktop/views/components/media-image-dialog.vue +++ b/src/client/app/desktop/views/components/media-image-dialog.vue @@ -26,7 +26,7 @@ export default Vue.extend({ opacity: 0, duration: 100, easing: 'linear', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); } } diff --git a/src/client/app/desktop/views/components/media-video-dialog.vue b/src/client/app/desktop/views/components/media-video-dialog.vue index 959cefa42..03c93c893 100644 --- a/src/client/app/desktop/views/components/media-video-dialog.vue +++ b/src/client/app/desktop/views/components/media-video-dialog.vue @@ -28,7 +28,7 @@ export default Vue.extend({ opacity: 0, duration: 100, easing: 'linear', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); } } diff --git a/src/client/app/desktop/views/components/ui-notification.vue b/src/client/app/desktop/views/components/ui-notification.vue index 68413914c..751912487 100644 --- a/src/client/app/desktop/views/components/ui-notification.vue +++ b/src/client/app/desktop/views/components/ui-notification.vue @@ -27,7 +27,7 @@ export default Vue.extend({ translateY: -64, duration: 500, easing: 'easeInElastic', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); }, 6000); }); diff --git a/src/client/app/desktop/views/components/user-preview.vue b/src/client/app/desktop/views/components/user-preview.vue index 1e1755ec3..f6d6d68a7 100644 --- a/src/client/app/desktop/views/components/user-preview.vue +++ b/src/client/app/desktop/views/components/user-preview.vue @@ -75,7 +75,7 @@ export default Vue.extend({ 'margin-top': '-8px', duration: 200, easing: 'easeOutQuad', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); } } diff --git a/src/client/app/desktop/views/components/window.vue b/src/client/app/desktop/views/components/window.vue index ec044ad27..30f0ec558 100644 --- a/src/client/app/desktop/views/components/window.vue +++ b/src/client/app/desktop/views/components/window.vue @@ -106,7 +106,7 @@ export default Vue.extend({ mounted() { if (this.preventMount) { - this.$destroy(); + this.destroyDom(); return; } @@ -190,7 +190,7 @@ export default Vue.extend({ }); setTimeout(() => { - this.$destroy(); + this.destroyDom(); this.$emit('closed'); }, 300); }, diff --git a/src/client/app/init.ts b/src/client/app/init.ts index dfc3a819b..db3852da6 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -31,9 +31,13 @@ require('./common/views/widgets'); require('./common/views/filters'); Vue.mixin({ - destroyed(this: any) { - if (this.$el.parentNode) { - this.$el.parentNode.removeChild(this.$el); + methods: { + destroyDom() { + this.$destroy(); + + if (this.$el.parentNode) { + this.$el.parentNode.removeChild(this.$el); + } } } }); diff --git a/src/client/app/mobile/views/components/dialog.vue b/src/client/app/mobile/views/components/dialog.vue index 9ee01cb78..6a0d74c75 100644 --- a/src/client/app/mobile/views/components/dialog.vue +++ b/src/client/app/mobile/views/components/dialog.vue @@ -78,7 +78,7 @@ export default Vue.extend({ scale: 0.8, duration: 300, easing: [ 0.5, -0.5, 1, 0.5 ], - complete: () => this.$destroy() + complete: () => this.destroyDom() }); }, onBgClick() { diff --git a/src/client/app/mobile/views/components/drive-file-chooser.vue b/src/client/app/mobile/views/components/drive-file-chooser.vue index aaa707d8a..92ac211af 100644 --- a/src/client/app/mobile/views/components/drive-file-chooser.vue +++ b/src/client/app/mobile/views/components/drive-file-chooser.vue @@ -31,15 +31,15 @@ export default Vue.extend({ }, onSelected(file) { this.$emit('selected', file); - this.$destroy(); + this.destroyDom(); }, cancel() { this.$emit('canceled'); - this.$destroy(); + this.destroyDom(); }, ok() { this.$emit('selected', this.files); - this.$destroy(); + this.destroyDom(); } } }); diff --git a/src/client/app/mobile/views/components/drive-folder-chooser.vue b/src/client/app/mobile/views/components/drive-folder-chooser.vue index 7934fb781..6d3fba1ef 100644 --- a/src/client/app/mobile/views/components/drive-folder-chooser.vue +++ b/src/client/app/mobile/views/components/drive-folder-chooser.vue @@ -19,11 +19,11 @@ export default Vue.extend({ methods: { cancel() { this.$emit('canceled'); - this.$destroy(); + this.destroyDom(); }, ok() { this.$emit('selected', (this.$refs.browser as any).folder); - this.$destroy(); + this.destroyDom(); } } }); diff --git a/src/client/app/mobile/views/components/friends-maker.vue b/src/client/app/mobile/views/components/friends-maker.vue index e0461d2bc..dbb82f4b1 100644 --- a/src/client/app/mobile/views/components/friends-maker.vue +++ b/src/client/app/mobile/views/components/friends-maker.vue @@ -47,7 +47,7 @@ export default Vue.extend({ this.fetch(); }, close() { - this.$destroy(); + this.destroyDom(); } } }); diff --git a/src/client/app/mobile/views/components/notify.vue b/src/client/app/mobile/views/components/notify.vue index 307fb08cf..5f94b91dd 100644 --- a/src/client/app/mobile/views/components/notify.vue +++ b/src/client/app/mobile/views/components/notify.vue @@ -32,7 +32,7 @@ export default Vue.extend({ [this.pos]: `-${this.$el.offsetHeight}px`, duration: 500, easing: 'easeOutQuad', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); }, 6000); }); diff --git a/src/client/app/mobile/views/components/post-form-dialog.vue b/src/client/app/mobile/views/components/post-form-dialog.vue index ec3738651..15b36db94 100644 --- a/src/client/app/mobile/views/components/post-form-dialog.vue +++ b/src/client/app/mobile/views/components/post-form-dialog.vue @@ -79,7 +79,7 @@ export default Vue.extend({ translateY: 16, duration: 300, easing: 'easeOutQuad', - complete: () => this.$destroy() + complete: () => this.destroyDom() }); },