From fd3bfbea75150df8b44adf8ce73c8bbbc227689a Mon Sep 17 00:00:00 2001 From: Antoine Beaubien Date: Fri, 16 Apr 2021 12:06:04 -0400 Subject: [PATCH] (I #2771) Control facet panel width thru a preference (#2772) * First implementation, functional First implementation, functional. Only 2 lines of code. * Added min 200px, max 500px Added validation to constrait the panel to have at least a minimum of 200px and a maximum of 500px. * Update project.js Change the pref key to facetsHistoryPanelWidth. * Change to ui.browsing.facetsHistoryPanelWidth Change ui.facetsHistoryPanelWidth to ui.browsing.facetsHistoryPanelWidth. Co-authored-by: Antonin Delpeuch --- main/webapp/modules/core/scripts/project.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/webapp/modules/core/scripts/project.js b/main/webapp/modules/core/scripts/project.js index e3d68d72c..74cb930e0 100644 --- a/main/webapp/modules/core/scripts/project.js +++ b/main/webapp/modules/core/scripts/project.js @@ -63,7 +63,11 @@ Refine.reportException = function(e) { }; function resize() { - var leftPanelWidth = 300; + var leftPanelWidth = JSON.parse(Refine.getPreference("ui.browsing.facetsHistoryPanelWidth", 300)); + if(typeof leftPanelWidth != "number" || leftPanelWidth < 200 || leftPanelWidth > 500) { + leftPanelWidth = 300; + } + var width = $(window).width(); var top = $("#header").outerHeight(); var height = $(window).height() - top;