Skip to content

Commit

Permalink
Fix missing help buttons and help buttons that only show as ?
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Oct 26, 2021
1 parent c1dc212 commit 79742de
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions war/src/main/webapp/scripts/hudson-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,7 @@ function rowvgStartEachRow(recursive,f) {
*/
Behaviour.specify('label.js-checkbox-label-empty', 'form-fallbacks', 1000, function(label) {
var labelParent = label.parentElement;

if (!labelParent.classList.contains('setting-main')) return;

function findSettingName(formGroup) {
Expand All @@ -1497,20 +1498,21 @@ function rowvgStartEachRow(recursive,f) {

var settingName = findSettingName(labelParent.parentNode);
if (settingName == undefined) return
var helpLink = settingName.querySelector('.setting-help');

// Copy setting-name text and append it to the checkbox label
var labelText = settingName.innerText;
var spanTag = document.createElement('span')
spanTag.innerHTML = labelText
label.appendChild(spanTag)
var helpLink = settingName.querySelector('.jenkins-help-button');

if (helpLink) {
labelParent.classList.add('help-sibling');
labelParent.appendChild(helpLink);
}

labelParent.parentNode.removeChild(settingName);

// Copy setting-name text and append it to the checkbox label
var labelText = settingName.innerText;

var spanTag = document.createElement('span')
spanTag.innerHTML = labelText
label.appendChild(spanTag)
});
})();

Expand Down

0 comments on commit 79742de

Please sign in to comment.