Skip to content

Commit

Permalink
fix multiselect checkboxes
Browse files Browse the repository at this point in the history
Signed-off-by: Vinzenz Rosenkranz <[email protected]>
  • Loading branch information
v1r0x committed Oct 17, 2023
1 parent 8b4d66b commit 8c17fc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions resources/js/bootstrap/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {
faChevronLeft,
faChevronRight,
faCircle,
faCircleCheck,
faClipboard,
faClock,
faClone,
Expand Down Expand Up @@ -245,6 +246,7 @@ library.add(
faChevronLeft,
faChevronRight,
faCircle,
faCircleCheck,
faCircleReg,
faClipboard,
faClock,
Expand Down
17 changes: 14 additions & 3 deletions resources/js/components/tree/Node.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<template>
<div @dragenter="onDragEnter" @dragleave="onDragLeave" :id="`tree-node-${data.id}`">
<input class="mx-1 form-check-input" type="checkbox" :disabled="state.isSelectionDisabled" :id="`tree-node-mes-${data.id}`" v-model="state.multieditSelected" v-show="state.isSelectionMode" @click.stop="addToMSList()" />
<div @dragenter="onDragEnter" @dragleave="onDragLeave" :id="`tree-node-${data.id}`" @click="e => addToMSList(e)">
<span v-show="state.isSelectionMode" class="mx-1">
<span v-show="state.multieditSelected" class="text-success">
<i class="fas fa-fw fa-circle-check"></i>
</span>
<span v-show="!state.multieditSelected">
<i class="far fa-fw fa-circle"></i>
</span>
</span>
<a href="" :id="`tree-node-cm-toggle-${data.id}`" @click.prevent @contextmenu.stop.prevent="togglePopup()" class="text-body text-decoration-none disabled" data-bs-toggle="dropdown" data-bs-auto-close="true" aria-expanded="false">
<span style="display: inline-block; text-align: center;" class="px-1">
<span v-if="data.children_count" class="badge rounded-pill" style="font-size: 9px;" :style="state.colorStyles" :title="data.children_count">
Expand Down Expand Up @@ -152,7 +159,11 @@
const onDragLeave = _ => {
};
const addToMSList = _ => {
const addToMSList = event => {
if(!state.isSelectionMode) return;
event.stopPropagation();
event.preventDefault();
state.multieditSelected = !state.multieditSelected;
if(state.multieditSelected) {
store.dispatch('addToTreeSelection', {
Expand Down

0 comments on commit 8c17fc8

Please sign in to comment.