From cc4f83ea9f89cf94290f81b369c32d520808fe70 Mon Sep 17 00:00:00 2001 From: jokd Date: Mon, 21 Aug 2023 09:21:01 +0200 Subject: [PATCH] Added settingsExpanded option --- src/controls/print/index.js | 4 +++- src/controls/print/print-component.js | 4 +++- src/controls/print/print-settings.js | 8 +++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/controls/print/index.js b/src/controls/print/index.js index c5a724279..ed64d0761 100644 --- a/src/controls/print/index.js +++ b/src/controls/print/index.js @@ -50,7 +50,8 @@ const Print = function Print(options = {}) { filename, mapInteractionsActive = false, supressResolutionsRecalculation = false, - suppressNewDPIMethod = false + suppressNewDPIMethod = false, + settingsExpanded = false } = options; let { showNorthArrow = true, @@ -114,6 +115,7 @@ const Print = function Print(options = {}) { showMargins, showCreated, createdPrefix, + settingsExpanded, showScale, showNorthArrow, showPrintLegend, diff --git a/src/controls/print/print-component.js b/src/controls/print/print-component.js index 2a732e76d..ae6940e31 100644 --- a/src/controls/print/print-component.js +++ b/src/controls/print/print-component.js @@ -50,7 +50,8 @@ const PrintComponent = function PrintComponent(options = {}) { leftFooterText, mapInteractionsActive, supressResolutionsRecalculation, - suppressNewDPIMethod + suppressNewDPIMethod, + settingsExpanded } = options; let { @@ -320,6 +321,7 @@ const PrintComponent = function PrintComponent(options = {}) { resolution, scales, scaleInitial, + settingsExpanded, showMargins, showCreated, showScale, diff --git a/src/controls/print/print-settings.js b/src/controls/print/print-settings.js index 80d1f4dc3..8cbb4cfd4 100644 --- a/src/controls/print/print-settings.js +++ b/src/controls/print/print-settings.js @@ -44,6 +44,7 @@ const PrintSettings = function PrintSettings(options = {}) { resolution, scales, scaleInitial, + settingsExpanded, showMargins, showCreated, showScale, @@ -117,7 +118,7 @@ const PrintSettings = function PrintSettings(options = {}) { icon: openIcon, tooltipText: 'Visa inställningar', tooltipPlacement: 'east', - state: 'initial', + state: settingsExpanded === true ? 'hidden' : 'initial', validStates: ['initial', 'hidden'], click() { toggle(); @@ -126,7 +127,7 @@ const PrintSettings = function PrintSettings(options = {}) { closeButton = Button({ cls: 'small round margin-top-small margin-right small icon-smaller grey-lightest', icon: closeIcon, - state: 'hidden', + state: settingsExpanded === true ? 'initial' : 'hidden', validStates: ['initial', 'hidden'], ariaLabel: 'Stäng', click() { @@ -216,7 +217,8 @@ const PrintSettings = function PrintSettings(options = {}) { collapseY: true, headerComponent, contentComponent, - mainCls: 'collapse-scroll' + mainCls: 'collapse-scroll', + expanded: settingsExpanded === true }); this.addComponent(printSettingsContainer);