From 07b35fcce04e4414a794a402f8841a05a54cc7b3 Mon Sep 17 00:00:00 2001 From: chiayin Date: Wed, 14 Jun 2023 12:56:09 +0800 Subject: [PATCH] Discover: sidebarFilter Sequence Sequence fix dblclick no need to hide arrow. Update v0.99.1 --- src/components/Discover/Filter/ActAndSeq.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/Discover/Filter/ActAndSeq.vue b/src/components/Discover/Filter/ActAndSeq.vue index 14599d8..0d914f0 100644 --- a/src/components/Discover/Filter/ActAndSeq.vue +++ b/src/components/Discover/Filter/ActAndSeq.vue @@ -74,15 +74,16 @@ export default { data() { return { listSequence: this.listSeq, - data: this.filterTaskData, + filteredData: this.filterTaskData, lastItemIndex: null, + isDragging: false, } }, computed: { data: function() { // TODO Activity List 的 dblclick, drag & drop 要改假刪除 // Activity List 要排序 - return this.data.sort((x, y) => y.occurrences - x.occurrences); + return this.filteredData.sort((x, y) => y.occurrences - x.occurrences); } }, watch: { @@ -116,6 +117,7 @@ export default { * Element dragging started */ onStart(evt) { + this.isDragging = true; // 隱藏拖曳元素原位置 const originalElement = evt.item; originalElement.style.display = 'none'; @@ -127,6 +129,7 @@ export default { * Element dragging ended */ onEnd(evt) { + this.isDragging = false; // 顯示拖曳元素 const originalElement = evt.item; originalElement.style.display = ''; @@ -144,8 +147,9 @@ export default { */ onChoose(evt) { // 拖曳時要隱藏箭頭 + // isDragging: 只有拖曳才要隱藏,dblclick 不用 const lastChild = evt.item.lastChild; - lastChild.style.display = 'none'; + if (this.isDragging) lastChild.style.display = 'none'; } } }