Skip to content

Commit

Permalink
fix: 修复非触屏设备上的操作按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Mar 17, 2024
1 parent 7a809a1 commit 5f6f844
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/FileListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,14 @@
if (swipeIsOpen.value) {
swipe.value.close();
swipeIsOpen.value = false;
moreAction.value.style.transform = 'rotate(0deg)';
if(moreAction.value) moreAction.value.style.transform = 'rotate(0deg)';
} else {
if (isLeftRight.value) {
swipe.value.open('right');
} else {
swipe.value.open('left');
swipeIsOpen.value = true;
moreAction.value.style.transform = 'rotate(180deg)';
if(moreAction.value) moreAction.value.style.transform = 'rotate(180deg)';
}
}
};
Expand All @@ -322,6 +322,7 @@
const onClickCopyConfig = async () => {
swipeController()
const data = JSON.parse(JSON.stringify(toRaw(props.file)));
data.name += `-copy${~~(Math.random() * 10000)}`;
Expand All @@ -338,6 +339,7 @@
};
const onClickDelete = () => {
swipeController()
Dialog({
title: t('subPage.deleteSub.title'),
content: createVNode(
Expand Down
7 changes: 5 additions & 2 deletions src/components/SubListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,14 @@ const swipeController = () => {
if (swipeIsOpen.value) {
swipe.value.close();
swipeIsOpen.value = false;
moreAction.value.style.transform = "rotate(0deg)";
if(moreAction.value) moreAction.value.style.transform = "rotate(0deg)";
} else {
if (isLeftRight.value) {
swipe.value.open("right");
} else {
swipe.value.open("left");
swipeIsOpen.value = true;
moreAction.value.style.transform = "rotate(180deg)";
if(moreAction.value) moreAction.value.style.transform = "rotate(180deg)";
}
}
};
Expand Down Expand Up @@ -459,6 +459,7 @@ const setTimeoutTF = () => {
const onClickPreviews = () => {
if (ismove.value) return;
swipeController()
Dialog({
title: t("subPage.previewTitle"),
content: createVNode(PreviewPanel, {
Expand Down Expand Up @@ -486,6 +487,7 @@ const onClickPreviews = () => {
};
const onClickCopyConfig = async () => {
swipeController()
let data: Sub | Collection;
switch (props.type) {
case "sub":
Expand All @@ -510,6 +512,7 @@ const onClickEdit = () => {
};
const onClickDelete = () => {
swipeController()
Dialog({
title: t("subPage.deleteSub.title"),
content: createVNode(
Expand Down

0 comments on commit 5f6f844

Please sign in to comment.