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

[24.0] Embed fix #17852

Merged
merged 1 commit into from
Mar 28, 2024
Merged
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
18 changes: 17 additions & 1 deletion client/src/components/Sharing/Embeds/WorkflowEmbed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const settings = reactive({
initialX: -20,
initialY: -20,
zoom: 1,
applyStyle: true,
});

function onChangePosition(event: Event, xy: "x" | "y") {
Expand Down Expand Up @@ -55,7 +56,16 @@ const embedUrl = computed(() => {
return url;
});

const embed = computed(() => `<iframe title="Galaxy Workflow Embed" src="${embedUrl.value}" />`);
const embedStyle = computed(() => {
if (settings.applyStyle) {
return ' style="width: 100%; height: 700px; border: none;" ';
} else {
return " ";
}
});
const embed = computed(
() => `<iframe title="Galaxy Workflow Embed"${embedStyle.value}src="${embedUrl.value}"></iframe>`
);

// These Embed settings are not reactive, to we have to key them
const embedKey = computed(() => `zoom: ${settings.zoom}, x: ${settings.initialX}, y: ${settings.initialY}`);
Expand Down Expand Up @@ -117,6 +127,12 @@ const clipboardTitle = computed(() => (copied.value ? "Copied!" : "Copy URL"));
class="zoom-control"
@onZoom="(level) => (settings.zoom = level)" />
</label>

<BFormCheckbox
v-model="settings.applyStyle"
title="adds a width, height, and removes the border of the iframe">
Add basic styling
</BFormCheckbox>
</div>
<div class="preview">
<label for="embed-code" class="w-100">
Expand Down
Loading