From 9c773be3ec07974a146369b836544e5c4625868d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pocrnji=C4=8D?= Date: Tue, 17 Mar 2026 21:04:25 +0100 Subject: [PATCH] fixed bug in permission edit where checked groups were not checked and remove left and right click image zooming --- .../DocumentsTable/DocumentViewerDialog.vue | 22 ++---------- resources/js/Pages/Admin/Permissions/Edit.vue | 34 +++++++++++++------ 2 files changed, 25 insertions(+), 31 deletions(-) diff --git a/resources/js/Components/DocumentsTable/DocumentViewerDialog.vue b/resources/js/Components/DocumentsTable/DocumentViewerDialog.vue index 4cacd6f..d59bc17 100644 --- a/resources/js/Components/DocumentsTable/DocumentViewerDialog.vue +++ b/resources/js/Components/DocumentsTable/DocumentViewerDialog.vue @@ -41,12 +41,11 @@ const dragStartTX = ref(0); const dragStartTY = ref(0); const MAX_SCALE = 8; -const ZOOM_FACTOR = 2; const imageCursorClass = computed(() => { if (isDragging.value && hasMoved.value) return "cursor-grabbing"; if (imageScale.value > fitScale.value + 0.01) return "cursor-grab"; - return "cursor-zoom-in"; + return "cursor-default"; }); const initImageView = () => { @@ -112,20 +111,6 @@ const handleImageLoad = () => { initImageView(); }; -const handleClick = (e) => { - if (hasMoved.value) return; - const { mx, my } = mousePos(e); - zoomAt(mx, my, ZOOM_FACTOR); -}; - -const handleContextMenu = (e) => { - e.preventDefault(); - if (hasMoved.value) return; - if (imageScale.value <= fitScale.value + 0.01) return; - const { mx, my } = mousePos(e); - zoomAt(mx, my, 1 / ZOOM_FACTOR); -}; - const handleWheel = (e) => { e.preventDefault(); const { mx, my } = mousePos(e); @@ -152,7 +137,6 @@ const onMouseMove = (e) => { const onMouseUp = () => { isDragging.value = false; - // Delay reset so the click/contextmenu handler that fires after mouseup can still read hasMoved setTimeout(() => { hasMoved.value = false; }, 0); @@ -338,8 +322,6 @@ watch( ref="containerRef" class="relative h-full overflow-hidden select-none" :class="imageCursorClass" - @click="handleClick" - @contextmenu="handleContextMenu" @mousedown="handleMouseDown" @wheel.prevent="handleWheel" > @@ -377,7 +359,7 @@ watch( v-if="imageScale <= fitScale + 0.01" class="absolute bottom-2 left-1/2 -translate-x-1/2 bg-black/40 text-white text-xs px-2 py-1 rounded pointer-events-none select-none" > - Klik za povečavo · Desni klik / kolesce za pomanjšavo · Povleči za premik + Kolesce za povečavo / pomanjšavo · Povleči za premik diff --git a/resources/js/Pages/Admin/Permissions/Edit.vue b/resources/js/Pages/Admin/Permissions/Edit.vue index 5301faf..9c77a87 100644 --- a/resources/js/Pages/Admin/Permissions/Edit.vue +++ b/resources/js/Pages/Admin/Permissions/Edit.vue @@ -2,7 +2,13 @@ import AdminLayout from "@/Layouts/AdminLayout.vue"; import { useForm, Link } from "@inertiajs/vue3"; import { KeyRoundIcon, ArrowLeftIcon, SaveIcon } from "lucide-vue-next"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/Components/ui/card"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/Components/ui/card"; import { Button } from "@/Components/ui/button"; import { Input } from "@/Components/ui/input"; import { Label } from "@/Components/ui/label"; @@ -36,12 +42,16 @@ function submit() {
-
+
Uredi dovoljenje - Posodobi sistemsko dovoljenje in pripete vloge. + Posodobi sistemsko dovoljenje in pripete vloge.
-
@@ -86,16 +95,19 @@ function submit() { class="flex items-center gap-2 text-sm cursor-pointer" > {{ r.name }} - ({{ r.slug }})({{ r.slug }})