Skip to content
Open
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
10 changes: 5 additions & 5 deletions web/src/components/ControlsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async function fitMap() {
loadingBounds.value = false;
}

async function takeScreenshot() {
async function takeScreenshot(showSidebars: boolean) {
copyMenuShown.value = false;
const screenshotTarget = document.getElementById("app");
if (screenshotTarget) {
Expand All @@ -207,7 +207,7 @@ async function takeScreenshot() {
return (
element.id === "controls-bar" ||
element.classList.contains("control-menu") ||
(mapOnly.value && element.classList.contains("v-navigation-drawer"))
(!showSidebars && element.classList.contains("v-navigation-drawer"))
);
},
});
Expand All @@ -219,7 +219,7 @@ async function takeScreenshot() {
}

async function copyScreenshot() {
const blob = await takeScreenshot();
const blob = await takeScreenshot(!mapOnly.value);
if (blob) {
const clipboardItem = new ClipboardItem({ "image/png": blob });
navigator.clipboard.write([clipboardItem]);
Expand All @@ -228,7 +228,7 @@ async function copyScreenshot() {
}

async function saveScreenshot() {
const blob = await takeScreenshot();
const blob = await takeScreenshot(!mapOnly.value);
if (blob) {
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
Expand All @@ -251,7 +251,7 @@ function animateCameraFlash() {
}

function showViewStateDialog() {
takeScreenshot().then((blob) => {
takeScreenshot(true).then((blob) => {
newViewStateThumbnail.value = blob;
});
showViewStateCreation.value = true;
Expand Down