@@ -388,6 +394,7 @@
@cell-mouse-enter="showFavorite"
@cell-mouse-leave="hideFavorite"
:heightDiff="300"
+ @row-contextmenu="openRight"
>
+
@@ -865,6 +880,7 @@ const top = () => {
};
const jump = async (url: string) => {
+ hideRightMenu();
history.splice(pointer + 1);
history.push(url);
pointer = history.length - 1;
@@ -1308,7 +1324,8 @@ const buttons = [
openDownload(row);
},
disabled: (row: File.File) => {
- return row.isDir;
+ debugger;
+ return row?.isDir;
},
},
{
@@ -1366,8 +1383,8 @@ const buttons = [
{
label: i18n.global.t('file.addFavorite'),
click: (row: File.File) => {
- if (row.favoriteID > 0) {
- remove(row.favoriteID);
+ if (row?.favoriteID > 0) {
+ remove(row?.favoriteID);
} else {
addToFavorite(row);
}
@@ -1424,6 +1441,36 @@ const handleDragleave = (event: { preventDefault: () => void }) => {
event.preventDefault();
};
+const menuVisible = ref(false);
+const noMenuVisible = ref(false);
+const menuPosition = reactive({ x: 0, y: 0 });
+const currentRow = ref
({} as File.File);
+
+function openRight(row: File.File, _column: any, event: MouseEvent) {
+ noMenuVisible.value = true;
+ if (row.name === currentRow.value?.name && menuVisible.value) {
+ menuVisible.value = false;
+ } else {
+ event.preventDefault();
+ currentRow.value = row;
+ menuPosition.x = event.clientX;
+ menuPosition.y = event.clientY;
+ menuVisible.value = true;
+ }
+}
+
+function hideRightMenu() {
+ menuVisible.value = false;
+}
+
+function onRightClick() {
+ if (noMenuVisible.value) {
+ noMenuVisible.value = false;
+ } else {
+ menuVisible.value = false;
+ }
+}
+
onMounted(() => {
if (localStorage.getItem('show-hidden') === null) {
localStorage.setItem('show-hidden', 'true');