From 945369ca3e9a6c68ed589a0d543f2fbe46dfa5a1 Mon Sep 17 00:00:00 2001 From: Rory Martin Date: Mon, 12 Feb 2024 19:42:06 +0000 Subject: [PATCH] Improved Pass Notification and Verify Button --- assets/components/Online/ExerciseVerify.vue | 6 +-- assets/components/Online/PassNotification.vue | 41 +++++++++++-------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/assets/components/Online/ExerciseVerify.vue b/assets/components/Online/ExerciseVerify.vue index f2dbea42..8343a8c4 100644 --- a/assets/components/Online/ExerciseVerify.vue +++ b/assets/components/Online/ExerciseVerify.vue @@ -146,8 +146,8 @@ const verifySolution = () => { -
- - +
-import { computed, onMounted, onUnmounted, ref } from "vue"; +import { computed, onMounted, onBeforeUnmount, ref } from "vue"; import Modal from "./ModalDialog.vue"; import FileTree from "./FileTree.vue"; import AceEditor from "./AceEditor.vue"; @@ -34,9 +34,10 @@ onMounted(() => { }; document.addEventListener("keyup", el.value.escapeEventHandler, true); + el.value.focus(); }); -onUnmounted(() => { +onBeforeUnmount(() => { document.removeEventListener("keyup", el.value.escapeEventHandler); }); @@ -46,11 +47,11 @@ const officialSolutionFileTree = ref( props.officialSolution === null ? [] : props.officialSolution.map((file, i) => { - return { - id: i, - name: file.file_path, - }; - }), + return { + id: i, + name: file.file_path, + }; + }), ); const fileTreeStyles = { @@ -75,6 +76,7 @@ const files = computed(() => { const dismissPassNotification = () => { emit("close"); + console.log("Here"); }; const showOfficialSolution = () => { @@ -93,8 +95,9 @@ const isSelectedFile = (file) => {