From ea2b2a35bb5c419970b796ec010085302d8c9bd1 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 10 Jun 2020 12:41:02 +0300 Subject: [PATCH] add fade-in fade-out --- .../post_status_form/post_status_form.js | 9 +++++---- .../post_status_form/post_status_form.vue | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 3de6f70a..9027566f 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -83,7 +83,7 @@ const PostStatusForm = { }, caret: 0, pollFormVisible: false, - showDropIcon: false, + showDropIcon: 'hide', dropStopTimeout: null } }, @@ -254,7 +254,7 @@ const PostStatusForm = { e.preventDefault() // allow dropping text like before this.dropFiles = e.dataTransfer.files clearTimeout(this.dropStopTimeout) - this.showDropIcon = false + this.showDropIcon = 'hide' } }, fileDragStop (e) { @@ -262,13 +262,14 @@ const PostStatusForm = { // directly caused unwanted flickering, this is not perfect either but // much less noticable. clearTimeout(this.dropStopTimeout) - this.dropStopTimeout = setTimeout(() => (this.showDropIcon = false), 100) + this.showDropIcon = 'fade' + this.dropStopTimeout = setTimeout(() => (this.showDropIcon = 'hide'), 500) }, fileDrag (e) { e.dataTransfer.dropEffect = 'copy' if (e.dataTransfer && e.dataTransfer.types.includes('Files')) { clearTimeout(this.dropStopTimeout) - this.showDropIcon = true + this.showDropIcon = 'show' } }, onEmojiInputInput (e) { diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index e23e9e48..c4d7f7e2 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -9,7 +9,8 @@ @dragover.prevent="fileDrag" >