dynamic view > compare mode : disable comment
This commit is contained in:
parent
b4be010af7
commit
f74c818ffc
3 changed files with 16 additions and 2 deletions
|
|
@ -50,8 +50,10 @@ import { ref, computed, watch } from "vue";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import { usePageStore } from "../../../stores/page";
|
import { usePageStore } from "../../../stores/page";
|
||||||
import Interactive360 from "./Interactive360.vue";
|
import Interactive360 from "./Interactive360.vue";
|
||||||
|
import { useDialogStore } from "../../../stores/dialog";
|
||||||
|
|
||||||
const { page } = storeToRefs(usePageStore());
|
const { page } = storeToRefs(usePageStore());
|
||||||
|
const { isCommentsOpen, isCommentPanelEnabled } = storeToRefs(useDialogStore());
|
||||||
|
|
||||||
const tracks = computed(
|
const tracks = computed(
|
||||||
() => page.value.steps[page.value.steps.length - 1].files.dynamic
|
() => page.value.steps[page.value.steps.length - 1].files.dynamic
|
||||||
|
|
@ -59,6 +61,13 @@ const tracks = computed(
|
||||||
|
|
||||||
const isCompareModeEnabled = ref(false);
|
const isCompareModeEnabled = ref(false);
|
||||||
watch(isCompareModeEnabled, (newValue) => {
|
watch(isCompareModeEnabled, (newValue) => {
|
||||||
|
if (newValue) {
|
||||||
|
isCommentsOpen.value = false;
|
||||||
|
isCommentPanelEnabled.value = false;
|
||||||
|
} else {
|
||||||
|
isCommentPanelEnabled.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!newValue && activeTracks.value.length === 2) {
|
if (!newValue && activeTracks.value.length === 2) {
|
||||||
activeTracks.value.pop();
|
activeTracks.value.pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,16 @@
|
||||||
}}</span>
|
}}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
v-if="isCommentPanelEnabled"
|
||||||
id="toggle-comments"
|
id="toggle-comments"
|
||||||
:aria-pressed="isCommentsOpen"
|
:aria-pressed="isCommentsOpen"
|
||||||
class="btn btn--transparent btn--outline"
|
class="btn btn--transparent btn--outline"
|
||||||
data-icon="comment"
|
data-icon="comment"
|
||||||
@click="isCommentsOpen = !isCommentsOpen"
|
@click="isCommentsOpen = !isCommentsOpen"
|
||||||
>
|
>
|
||||||
<span class="sr-only">{{ isCommentsOpen ? 'Masquer' : 'Afficher' }} les commentaires</span>
|
<span class="sr-only"
|
||||||
|
>{{ isCommentsOpen ? "Masquer" : "Afficher" }} les commentaires</span
|
||||||
|
>
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<Comments v-if="isCommentsOpen" @show-draft-marker="showDraftMarker" />
|
<Comments v-if="isCommentsOpen" @show-draft-marker="showDraftMarker" />
|
||||||
|
|
@ -102,7 +105,7 @@ const { activeTab, currentFile, step, isLoopAnimationEnabled } = storeToRefs(
|
||||||
useVirtualSampleStore()
|
useVirtualSampleStore()
|
||||||
);
|
);
|
||||||
isLoopAnimationEnabled.value = false;
|
isLoopAnimationEnabled.value = false;
|
||||||
const { isCommentsOpen } = storeToRefs(useDialogStore());
|
const { isCommentsOpen, isCommentPanelEnabled } = storeToRefs(useDialogStore());
|
||||||
|
|
||||||
// Variables
|
// Variables
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ export const useDialogStore = defineStore("dialog", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const isCommentPanelEnabled = ref(true);
|
||||||
const isCommentsOpen = ref(
|
const isCommentsOpen = ref(
|
||||||
route.query.hasOwnProperty("comments") ? true : false
|
route.query.hasOwnProperty("comments") ? true : false
|
||||||
);
|
);
|
||||||
|
|
@ -133,6 +134,7 @@ export const useDialogStore = defineStore("dialog", () => {
|
||||||
comments,
|
comments,
|
||||||
draftComment,
|
draftComment,
|
||||||
isCommentsOpen,
|
isCommentsOpen,
|
||||||
|
isCommentPanelEnabled,
|
||||||
updateFile,
|
updateFile,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue