(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 <antonin@delpeuch.eu>
This commit is contained in:
Antoine Beaubien 2021-04-16 12:06:04 -04:00 committed by GitHub
parent 6e472376aa
commit fd3bfbea75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;