Discover: sidebarFilter Sequence Sequence fix dblclick no need to hide arrow. Update v0.99.1

This commit is contained in:
chiayin
2023-06-14 12:56:09 +08:00
parent 79ab329d87
commit 07b35fcce0

View File

@@ -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';
}
}
}