From 20b09e86342a598c93dc0d7da26d6e32f7d76bdd Mon Sep 17 00:00:00 2001 From: Azgaar Date: Sun, 19 Nov 2023 17:12:09 +0400 Subject: [PATCH] feat: fitMapToScreen on canvas site restoring --- modules/ui/options.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/ui/options.js b/modules/ui/options.js index 0bac147b..07697cce 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -178,6 +178,14 @@ function mapSizeInputChange() { } } +function restoreDefaultCanvasSize() { + mapWidthInput.value = window.innerWidth; + mapHeightInput.value = window.innerHeight; + localStorage.removeItem("mapHeight"); + localStorage.removeItem("mapWidth"); + fitMapToScreen(); +} + // on map creation function applyGraphSize() { graphWidth = +mapWidthInput.value; @@ -212,13 +220,6 @@ function fitMapToScreen() { if (window.fitLegendBox) fitLegendBox(); } -function restoreDefaultCanvasSize() { - mapWidthInput.value = window.innerWidth; - mapHeightInput.value = window.innerHeight; - localStorage.removeItem("mapHeight"); - localStorage.removeItem("mapWidth"); -} - function toggleTranslateExtent(el) { const on = (el.dataset.on = +!+el.dataset.on); if (on) {