From 6ae88c09f6307a6f6286ecc62f42c7fcbe56ceb4 Mon Sep 17 00:00:00 2001 From: Markus Winter Date: Fri, 26 Jul 2024 22:38:24 +0200 Subject: [PATCH] remove dead yui code since longer time the repeatable delete is no longer a button created by yui but directly converted by Jenkins core to button element with class jenkins-button. So the call to YAHOO.widget.Button.getButton(e.id) will always return undefined. The layoutUpdateCallback will make sure that when the delete button is clicked the traitSectionRule is called. --- .../resources/jenkins/scm/api/form/traits/traits.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/main/resources/jenkins/scm/api/form/traits/traits.js b/src/main/resources/jenkins/scm/api/form/traits/traits.js index 21ca3be6..5008e417 100644 --- a/src/main/resources/jenkins/scm/api/form/traits/traits.js +++ b/src/main/resources/jenkins/scm/api/form/traits/traits.js @@ -31,17 +31,4 @@ e.querySelectorAll(".trait-section").forEach(traitSectionRule); }) }); - Behaviour.specify(".repeatable-delete", 'traits', 500, function (e) { - var c = e.closest(".trait-container"); - if (c) { - var btn = YAHOO.widget.Button.getButton(e.id); - if (btn) { - btn.on("click", function () { - window.setTimeout(function () { - c.querySelectorAll(".trait-section").forEach(traitSectionRule); - }, 250); - }); - } - } - }); })();