Skip to content

Commit 457dbb0

Browse files
authored
Merge pull request #423 from OpenGeoscience/fix-view-screenshots
Fix screenshot map-only behavior
2 parents 5a93e15 + 0725fe7 commit 457dbb0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

web/src/components/ControlsBar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ async function fitMap() {
198198
loadingBounds.value = false;
199199
}
200200
201-
async function takeScreenshot() {
201+
async function takeScreenshot(showSidebars: boolean) {
202202
copyMenuShown.value = false;
203203
const screenshotTarget = document.getElementById("app");
204204
if (screenshotTarget) {
@@ -207,7 +207,7 @@ async function takeScreenshot() {
207207
return (
208208
element.id === "controls-bar" ||
209209
element.classList.contains("control-menu") ||
210-
(mapOnly.value && element.classList.contains("v-navigation-drawer"))
210+
(!showSidebars && element.classList.contains("v-navigation-drawer"))
211211
);
212212
},
213213
});
@@ -219,7 +219,7 @@ async function takeScreenshot() {
219219
}
220220
221221
async function copyScreenshot() {
222-
const blob = await takeScreenshot();
222+
const blob = await takeScreenshot(!mapOnly.value);
223223
if (blob) {
224224
const clipboardItem = new ClipboardItem({ "image/png": blob });
225225
navigator.clipboard.write([clipboardItem]);
@@ -228,7 +228,7 @@ async function copyScreenshot() {
228228
}
229229
230230
async function saveScreenshot() {
231-
const blob = await takeScreenshot();
231+
const blob = await takeScreenshot(!mapOnly.value);
232232
if (blob) {
233233
const link = document.createElement("a");
234234
link.href = URL.createObjectURL(blob);
@@ -251,7 +251,7 @@ function animateCameraFlash() {
251251
}
252252
253253
function showViewStateDialog() {
254-
takeScreenshot().then((blob) => {
254+
takeScreenshot(true).then((blob) => {
255255
newViewStateThumbnail.value = blob;
256256
});
257257
showViewStateCreation.value = true;

0 commit comments

Comments
 (0)