diff --git a/app.vue b/app.vue index 1819aea..07b0d47 100644 --- a/app.vue +++ b/app.vue @@ -17,7 +17,8 @@ let files = ref([]); let filesList = ref([]); let selectedItem = useSelectedItem(); let filesGridList = ref([]) -let selectedList = ref([]) +let selectedList = ref([]); +let history = new HistorySwitcher(selectedItem); watchEffect(async () => { if (files.value?.[0]) { @@ -47,7 +48,7 @@ watchEffect(async () => { }) function onDrop(e: any) { - if(!e.dataTransfer.files.length) return; + if (!e.dataTransfer.files.length) return; files.value = e.dataTransfer.files; selectedItem.value = '/'; } @@ -102,11 +103,6 @@ watchEffect(() => { } }) -watchEffect(() => { - console.log(selectedList.value) -}) - - let dragContainer = document.querySelector(".select-area"); function onSelectStart(e: any) { @@ -131,6 +127,16 @@ function onSelectEnd(e: any) { }); } +// step up from current path +function stepUp(path: string) { + let pathArray = path.split("/"); + if(path.endsWith("/")) { + pathArray.pop(); + } + pathArray.pop(); + return (pathArray.join("/") || "")+ "/"; +} +