Home / Forum / Tips&Tricks / Form: Changing left/right layout from 50%/50% -> 75%/25%
Form: Changing left/right layout from 50%/50% -> 75%/25%
31.08.2021 22:17

Hi everyone,

this is just a simple JavaScript which changes the assigned space of the left and right panel from 50% for each to 75% for the right and 25% for the left.

The JavaScript can be copy&pasted into a JS Form Rule (1) which gets added to Behavior tab (2) so it get's executed.


window.ccls = window.ccls || {};
ccls.changePanelWidth = {};
ccls.changePanelWidth.Timeout = 0;
ccls.changePanelWidth.TimeoutMax = 4;

ccls.changePanelWidth.execute = function (pathId,alternativeLabel){
var items = document.getElementById("RightPanelOuter");
// verify that the element exists.
if (items == null ){
if (ccls.changePanelWidth.Timeout <= ccls.changePanelWidth.TimeoutMax){
ccls.changePanelWidth.Timeout ++;
setTimeout(function (){ccls.changePanelWidth.execute();},50)
}
return;
}
var elem = document.getElementById("RightPanelOuter");
elem.classList.replace("col-md-6","col-md-3")
elem = document.getElementById("LeftPanel");
elem.classList.replace("col-md-6","col-md-9")
}

ccls.changePanelWidth.execute();

Nobody has replied in this thread yet.