From a82293567f965c793dbef71be6e4522c1903cd0e Mon Sep 17 00:00:00 2001 From: Markus Winter Date: Tue, 19 Dec 2023 09:43:31 +0100 Subject: [PATCH] [JENKINS-71578] allow making sidepanel sticky (#8269) --- .../hudson/PluginManager/sidepanel.jelly | 2 +- .../resources/hudson/model/Job/configure.jelly | 2 +- core/src/main/resources/lib/layout/layout.jelly | 12 ++---------- .../main/resources/lib/layout/side-panel.jelly | 16 ++++++++++++++-- war/src/main/js/section-to-sidebar-items.js | 4 ---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/core/src/main/resources/hudson/PluginManager/sidepanel.jelly b/core/src/main/resources/hudson/PluginManager/sidepanel.jelly index 21755b32072d..0d3fc3fb43d3 100644 --- a/core/src/main/resources/hudson/PluginManager/sidepanel.jelly +++ b/core/src/main/resources/hudson/PluginManager/sidepanel.jelly @@ -27,7 +27,7 @@ THE SOFTWARE. --> - + diff --git a/core/src/main/resources/hudson/model/Job/configure.jelly b/core/src/main/resources/hudson/model/Job/configure.jelly index 040a54159041..d226a966558d 100644 --- a/core/src/main/resources/hudson/model/Job/configure.jelly +++ b/core/src/main/resources/hudson/model/Job/configure.jelly @@ -36,7 +36,7 @@ THE SOFTWARE. - +
diff --git a/core/src/main/resources/lib/layout/layout.jelly b/core/src/main/resources/lib/layout/layout.jelly index 877a4463356a..371c14ab1633 100644 --- a/core/src/main/resources/lib/layout/layout.jelly +++ b/core/src/main/resources/lib/layout/layout.jelly @@ -192,16 +192,8 @@ THE SOFTWARE.
-
- - - - - - -
- -
+ +
diff --git a/core/src/main/resources/lib/layout/side-panel.jelly b/core/src/main/resources/lib/layout/side-panel.jelly index 26b8afa3b647..01595ee8c881 100644 --- a/core/src/main/resources/lib/layout/side-panel.jelly +++ b/core/src/main/resources/lib/layout/side-panel.jelly @@ -26,10 +26,22 @@ THE SOFTWARE. Generates a left side content as part of a Jenkins page. Typically known as two-column or left-side + main-content layouts + + Make the side panel sticky. Should not be used on pages that include widgets in the sidepanel and when plugins can + add their own tasks, so the number of tasks is not fixed. + + - +
+ + + + +
+ +
- \ No newline at end of file + diff --git a/war/src/main/js/section-to-sidebar-items.js b/war/src/main/js/section-to-sidebar-items.js index 282198ed26ff..38683e995f5b 100644 --- a/war/src/main/js/section-to-sidebar-items.js +++ b/war/src/main/js/section-to-sidebar-items.js @@ -5,13 +5,9 @@ const HEADER_SELECTOR = const DEFAULT_ICON = ``; window.addEventListener("load", function () { - const sidebar = document.querySelector("#side-panel"); const sidebarItems = document.querySelector("#tasks"); const sectionHeaders = document.querySelectorAll(HEADER_SELECTOR); - // Ensure sidebar is sticky - sidebar.classList.add("app-page-body__sidebar--sticky"); - // Create the sidebar items sectionHeaders.forEach(function (header, i) { const headerId = toId(header.textContent);