From 85fc17b7b60206cc78908e292173769489602c07 Mon Sep 17 00:00:00 2001
From: Chris Beer <cabeer@stanford.edu>
Date: Mon, 21 Jun 2021 10:32:07 -0700
Subject: [PATCH] Increase the default elastic window size to 480x400 (#3460)

---
 __tests__/src/actions/window.test.js | 2 +-
 src/config/settings.js               | 4 ++++
 src/state/actions/window.js          | 3 +--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/__tests__/src/actions/window.test.js b/__tests__/src/actions/window.test.js
index bdccad860..27eae5823 100644
--- a/__tests__/src/actions/window.test.js
+++ b/__tests__/src/actions/window.test.js
@@ -45,7 +45,7 @@ describe('window actions', () => {
         ],
         elasticLayout: {
           height: 400,
-          width: 400,
+          width: 480,
           x: 260,
           y: 300,
         },
diff --git a/src/config/settings.js b/src/config/settings.js
index 43ec317f4..8ca8611ac 100644
--- a/src/config/settings.js
+++ b/src/config/settings.js
@@ -285,6 +285,10 @@ export default {
       { key: 'scroll', behaviors: ['continuous'] },
       { key: 'gallery' },
     ],
+    elastic: {
+      height: 400,
+      width: 480
+    }
   },
   windows: [ // Array of windows to be open when mirador initializes (each object should at least provide a manifestId key with the value of the IIIF presentation manifest to load)
     /**
diff --git a/src/state/actions/window.js b/src/state/actions/window.js
index 64a92aeec..e4f840bbb 100644
--- a/src/state/actions/window.js
+++ b/src/state/actions/window.js
@@ -83,8 +83,7 @@ export function addWindow({ companionWindows, manifest, ...options }) {
     };
 
     const elasticLayout = {
-      height: 400,
-      width: 400,
+      ...(config.window.elastic || { height: 400, width: 480 }),
       x: 200 + (Math.floor(numWindows / 10) * 50 + (numWindows * 30) % 300),
       y: 200 + ((numWindows * 50) % 300),
     };
-- 
GitLab