Skip to content

Commit

Permalink
Merge pull request #250 from raaymax/keeping_embeds_together
Browse files Browse the repository at this point in the history
fix: pdf drag and drop issues
  • Loading branch information
ramedina86 authored Feb 19, 2024
2 parents d2ae064 + 73109f6 commit 6d4728e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
6 changes: 3 additions & 3 deletions ui/src/core/templateMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import CoreSeparator from "../core_components/CoreSeparator.vue";
import CoreTab from "../core_components/CoreTab.vue";
import CoreTabs from "../core_components/CoreTabs.vue";
import CoreImage from "../core_components/CoreImage.vue";
import CorePDF from "../core_components/CorePDF.vue";
import CoreIFrame from "../core_components/CoreIFrame.vue";
import CoreGoogleMaps from "../core_components/embeds/CoreGoogleMaps.vue";
import CorePDF from "../core_components/embed/CorePDF.vue";
import CoreIFrame from "../core_components/embed/CoreIFrame.vue";
import CoreGoogleMaps from "../core_components/embed/CoreGoogleMaps.vue";
import CoreTimer from "../core_components/CoreTimer.vue";
import CoreWebcamCapture from "../core_components/CoreWebcamCapture.vue";
import CoreVegaLiteChart from "../core_components/CoreVegaLiteChart.vue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ watch(fields.mapId, initMap);
}
.CoreGoogleMaps.beingEdited .mask {
pointer-events: all;
pointer-events: auto;
position: absolute;
top: 0;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</template>

<script lang="ts">
import { FieldType } from "../streamsyncTypes";
import { cssClasses } from "../renderer/sharedStyleFields";
import { FieldType } from "../../streamsyncTypes";
import { cssClasses } from "../../renderer/sharedStyleFields";
const description = "A component to embed an external resource in an iframe.";
Expand Down Expand Up @@ -48,26 +48,30 @@ export default {

<script setup lang="ts">
import { Ref, inject, ref } from "vue";
import injectionKeys from "../injectionKeys";
import injectionKeys from "../../injectionKeys";
const rootEl:Ref<HTMLElement> = ref(null);
const fields = inject(injectionKeys.evaluatedFields);
function handleLoad(ev) {
function handleLoad() {
const event = new CustomEvent("ss-load");
rootEl.value.dispatchEvent(event);
}
</script>

<style scoped>
@import "../renderer/sharedStyles.css";
@import "../../renderer/sharedStyles.css";
.CoreIFrame {
position: relative;
width: 100%;
height: 80vh;
}
.CoreIFrame.beingEdited:not(.selected) iframe {
pointer-events: none;
}
.CoreIFrame iframe {
width: 100%;
height: 100%;
Expand All @@ -81,7 +85,7 @@ function handleLoad(ev) {
}
.CoreIFrame.beingEdited .mask {
pointer-events: all;
pointer-events: auto;
position: absolute;
top: 0;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="CorePDF">
<object class="pdf" :data="fields.source.value" type="application/pdf">
<object class="pdf" :data="fields.source.value" :key="fields.source.value" type="application/pdf">
<p>
You don't have a PDF plugin, but you can
You're not authorised to embed in the browser or you don't have PDF plugin
<a :href="fields.source.value">download the PDF file. </a>
</p>
</object>
Expand All @@ -11,8 +11,8 @@
</template>

<script lang='ts'>
import { FieldType } from "../streamsyncTypes";
import { cssClasses } from "../renderer/sharedStyleFields";
import { FieldType } from "../../streamsyncTypes";
import { cssClasses } from "../../renderer/sharedStyleFields";
const description =
"A component to embed a PDF document.";
Expand All @@ -36,18 +36,22 @@ export default {

<script setup lang="ts">
import { inject } from "vue";
import injectionKeys from "../injectionKeys";
import injectionKeys from "../../injectionKeys";
const fields = inject(injectionKeys.evaluatedFields);
</script>

<style scoped>
@import "../renderer/sharedStyles.css";
@import "../../renderer/sharedStyles.css";
.CorePDF {
position: relative;
width: 100%;
height: 80vh;
}
.CorePDF.beingEdited:not(.selected) object {
pointer-events: none;
}
.CorePDF .pdf {
width: 100%;
height: 100%;
Expand All @@ -61,7 +65,7 @@ const fields = inject(injectionKeys.evaluatedFields);
}
.CorePDF.beingEdited .mask {
pointer-events: all;
pointer-events: auto;
position: absolute;
top: 0;
left: 0;
Expand Down

0 comments on commit 6d4728e

Please sign in to comment.