(null);
const path = computed(() => {
- let basePath = fileStore.isFiles ? route.path : url.removeLastDir(route.path);
+ const routePath = props.path || route.path;
+ let basePath = fileStore.isFiles ? routePath : url.removeLastDir(routePath);
if (!basePath.endsWith("/")) {
basePath += "/";
}
diff --git a/frontend/src/components/prompts/FileList.vue b/frontend/src/components/prompts/FileList.vue
index 69478734..b2a1c6a2 100644
--- a/frontend/src/components/prompts/FileList.vue
+++ b/frontend/src/components/prompts/FileList.vue
@@ -168,7 +168,13 @@ export default {
this.showHover({
prompt: "newDir",
action: null,
- confirm: null,
+ confirm: (url) => {
+ const paths = url.split("/");
+ this.items.push({
+ name: paths[paths.length - 2],
+ url: url,
+ });
+ },
props: {
redirect: false,
base: this.current === this.$route.path ? null : this.current,
diff --git a/frontend/src/components/prompts/NewDir.vue b/frontend/src/components/prompts/NewDir.vue
index 85d47bb8..daa1b221 100644
--- a/frontend/src/components/prompts/NewDir.vue
+++ b/frontend/src/components/prompts/NewDir.vue
@@ -14,7 +14,7 @@
v-model.trim="name"
tabindex="1"
/>
-
+
@@ -41,7 +41,7 @@
diff --git a/frontend/src/css/base.css b/frontend/src/css/base.css
index f0b8ef0c..cdb3319b 100644
--- a/frontend/src/css/base.css
+++ b/frontend/src/css/base.css
@@ -182,10 +182,11 @@ html[dir="rtl"] .breadcrumbs a {
background: var(--textSecondary) !important;
}
-.vfm-modal {
- z-index: 9999999 !important;
-}
-
body > div[style*="z-index: 9990"] {
z-index: 10000 !important;
}
+
+#modal-background .button:focus {
+ outline: 1px solid #2195f32d;
+ outline-offset: 1px;
+}
diff --git a/frontend/src/css/styles.css b/frontend/src/css/styles.css
index 5ac7d8d5..bab7cd19 100644
--- a/frontend/src/css/styles.css
+++ b/frontend/src/css/styles.css
@@ -1,6 +1,5 @@
@import "normalize.css/normalize.css";
@import "vue-toastification/dist/index.css";
-@import "vue-final-modal/style.css";
@import "./_variables.css";
@import "./_buttons.css";
@import "./_inputs.css";
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 42f44205..f6b7ac78 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -2,7 +2,6 @@ import { disableExternal } from "@/utils/constants";
import { createApp } from "vue";
import VueNumberInput from "@chenfengyuan/vue-number-input";
import VueLazyload from "vue-lazyload";
-import { createVfm } from "vue-final-modal";
import Toast, { POSITION, useToast } from "vue-toastification";
import type {
ToastOptions,
@@ -27,7 +26,6 @@ dayjs.extend(relativeTime);
dayjs.extend(duration);
const pinia = createPinia(router);
-const vfm = createVfm();
const app = createApp(App);
@@ -39,7 +37,6 @@ app.use(Toast, {
newestOnTop: true,
} satisfies PluginOptions);
-app.use(vfm);
app.use(i18n);
app.use(pinia);
app.use(router);
diff --git a/frontend/src/stores/layout.ts b/frontend/src/stores/layout.ts
index 372fca06..fbd6d99f 100644
--- a/frontend/src/stores/layout.ts
+++ b/frontend/src/stores/layout.ts
@@ -76,7 +76,7 @@ export const useLayoutStore = defineStore("layout", {
});
},
closeHovers() {
- this.prompts.shift()?.close?.();
+ this.prompts.pop()?.close?.();
},
// easily reset state using `$reset`
clearLayout() {
diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue
index dbde609e..2b2852d3 100644
--- a/frontend/src/views/files/Editor.vue
+++ b/frontend/src/views/files/Editor.vue
@@ -121,7 +121,7 @@ const isMarkdownFile =
fileStore.req?.name.endsWith(".markdown");
const katexOptions = {
output: "mathml" as const,
- throwOnError: false
+ throwOnError: false,
};
marked.use(markedKatex(katexOptions));
@@ -233,6 +233,11 @@ const initEditor = (fileContent: string) => {
editor.value.setFontSize(fontSize.value);
editor.value.focus();
+
+ const selection = editor.value?.getSelection();
+ selection.on("changeSelection", function () {
+ isSelectionEmpty.value = selection.isEmpty();
+ });
};
const keyEvent = (event: KeyboardEvent) => {
@@ -296,6 +301,7 @@ const close = () => {
prompt: "discardEditorChanges",
confirm: (event: Event) => {
event.preventDefault();
+ editor.value?.session.getUndoManager().reset();
finishClose();
},
saveAction: async () => {