Skip to content

Commit

Permalink
components: widgets: IFrame: Do not use mouse internally when in edit…
Browse files Browse the repository at this point in the history
… mode

Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Oct 19, 2023
1 parent c38bfe0 commit 90e981d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/widgets/IFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<iframe
v-show="iframe_loaded"
:src="widget.options.source"
:style="iframeStyle"
frameborder="0"
height="100%"
width="100%"
Expand Down Expand Up @@ -30,10 +31,13 @@
</template>

<script setup lang="ts">
import { defineProps, onBeforeMount, ref, toRefs } from 'vue'
import { computed, defineProps, onBeforeMount, ref, toRefs } from 'vue'
import { useWidgetManagerStore } from '@/stores/widgetManager'
import type { Widget } from '@/types/widgets'
const widgetManagerStore = useWidgetManagerStore()
const props = defineProps<{
/**
* Widget reference
Expand All @@ -54,6 +58,13 @@ onBeforeMount(() => {
}
})
const iframeStyle = computed<string>(() => {
if (widgetManagerStore.editingMode) {
return 'pointer-events:none; border:0;'
}
return ''
})
/**
* Called when iframe finishes loading
*/
Expand Down

0 comments on commit 90e981d

Please sign in to comment.