fixed bug in permission edit where checked groups were not checked and remove left and right click image zooming
This commit is contained in:
@@ -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
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user