Skip to content

Commit

Permalink
PB-704 : also change the main iframe code snippet on route change
Browse files Browse the repository at this point in the history
  • Loading branch information
pakb committed Jul 12, 2024
1 parent 07b207a commit f756533
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/modules/menu/components/share/MenuShareEmbed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
// importing directly the vue component, see https://github.com/ivanvermeyen/vue-collapse-transition/issues/5
import CollapseTransition from '@ivanv/vue-collapse-transition/src/CollapseTransition.vue'
import { computed, nextTick, ref } from 'vue'
import { computed, nextTick, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router'
import { IFRAME_EVENTS } from '@/api/iframeFeatureEvent.api'
import MenuShareInputCopyButton from '@/modules/menu/components/share/MenuShareInputCopyButton.vue'
Expand Down Expand Up @@ -60,6 +61,7 @@ const customSize = ref({
const copied = ref(false)
const { t } = useI18n()
const route = useRoute()
const embedSource = ref(transformUrlMapToEmbed(window.location.href))
const embedPreviewModalWidth = computed(() => {
Expand Down Expand Up @@ -144,6 +146,13 @@ async function copyValue() {
log.error(`Failed to copy to clipboard:`, error)
}
}
watch(
() => route.query,
() => {
embedSource.value = transformUrlMapToEmbed(window.location.href)
}
)
</script>
<template>
Expand Down

0 comments on commit f756533

Please sign in to comment.