Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pdf drag and drop issues #250

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading