add waitingForComment position state
This commit is contained in:
parent
b99c05062f
commit
3e57a4bdc9
3 changed files with 7 additions and 2 deletions
|
|
@ -65,7 +65,7 @@
|
||||||
</button>
|
</button>
|
||||||
<!-- TODO: afficher #new-comment une fois le bouton Ajouter un commentaire cliqué -->
|
<!-- TODO: afficher #new-comment une fois le bouton Ajouter un commentaire cliqué -->
|
||||||
<div
|
<div
|
||||||
hidden
|
v-if="waitingForCommentPosition"
|
||||||
id="new-comment"
|
id="new-comment"
|
||||||
class="bg-primary | text-sm text-white | rounded-lg | p-12"
|
class="bg-primary | text-sm text-white | rounded-lg | p-12"
|
||||||
>
|
>
|
||||||
|
|
@ -131,6 +131,7 @@ const newCommentPosition = ref(null);
|
||||||
const newCommentText = ref("");
|
const newCommentText = ref("");
|
||||||
const isAddOpen = ref(false);
|
const isAddOpen = ref(false);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const waitingForCommentPosition = ref(false);
|
||||||
|
|
||||||
const sortedComments = computed(() => comments.value.reverse());
|
const sortedComments = computed(() => comments.value.reverse());
|
||||||
const sortedReplies = ref(null);
|
const sortedReplies = ref(null);
|
||||||
|
|
@ -209,9 +210,11 @@ function closeComment() {
|
||||||
|
|
||||||
function toggleCommentPositionMode(enable) {
|
function toggleCommentPositionMode(enable) {
|
||||||
if (enable) {
|
if (enable) {
|
||||||
|
waitingForCommentPosition.value = true;
|
||||||
viewContainer.classList.add("waiting-comment");
|
viewContainer.classList.add("waiting-comment");
|
||||||
viewContainer.addEventListener("click", handleCommentPositionClick);
|
viewContainer.addEventListener("click", handleCommentPositionClick);
|
||||||
} else {
|
} else {
|
||||||
|
waitingForCommentPosition.value = false;
|
||||||
viewContainer.classList.remove("waiting-comment");
|
viewContainer.classList.remove("waiting-comment");
|
||||||
viewContainer.removeEventListener("click", handleCommentPositionClick);
|
viewContainer.removeEventListener("click", handleCommentPositionClick);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,13 @@
|
||||||
dialog.content.slug === 'proposal'
|
dialog.content.slug === 'proposal'
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<VirtualSample v-if="dialog.content.slug === 'virtual-sample'" />
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import PdfViewer from "./brief/PdfViewer.vue";
|
import PdfViewer from "./brief/PdfViewer.vue";
|
||||||
import { useDialogStore } from "../../stores/dialog";
|
import { useDialogStore } from "../../stores/dialog";
|
||||||
|
import VirtualSample from "./VirtualSample.vue";
|
||||||
|
|
||||||
const dialog = useDialogStore();
|
const dialog = useDialogStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import Dialog from "primevue/dialog";
|
import Dialog from "primevue/dialog";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import ProductViewer from "./ProductViewer.vue";
|
|
||||||
|
|
||||||
const { file } = defineProps({
|
const { file } = defineProps({
|
||||||
file: Object,
|
file: Object,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue