Skip to content

Commit

Permalink
Merge pull request #10035 from janfaracik/fix-toggleswitch-attribute
Browse files Browse the repository at this point in the history
Fix attributes leaking in the toggle switch component
  • Loading branch information
krisstern authored Dec 9, 2024
2 parents 70544d9 + 43e0849 commit fa35f03
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/src/main/resources/lib/form/toggleSwitch.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ THE SOFTWARE.
disabled="${readOnlyMode ? 'true' : null}"
checked="${value ? 'true' : null}"/>
<label class="jenkins-toggle-switch__label ${id != null ? '' : 'attach-previous'}"
for="${id}" data-title="${title}" data-checked-title="${checkedTitle}">
for="${attrs.id}" data-title="${attrs.title}" data-checked-title="${attrs.checkedTitle}">
<j:choose>
<j:when test="${checkedTitle == null}">
${title}
<j:when test="${attrs.checkedTitle == null}">
${attrs.title}
</j:when>
<j:otherwise>
<span class="jenkins-toggle-switch__label__unchecked-title">${title}</span>
<span class="jenkins-toggle-switch__label__checked-title">${checkedTitle}</span>
<span class="jenkins-toggle-switch__label__unchecked-title">${attrs.title}</span>
<span class="jenkins-toggle-switch__label__checked-title">${attrs.checkedTitle}</span>
</j:otherwise>
</j:choose>
</label>
<j:if test="${description != null and !description.trim().isEmpty()}">
<span class="jenkins-toggle-switch__description">${description}</span>
<j:if test="${attrs.description != null and !attrs.description.trim().isEmpty()}">
<span class="jenkins-toggle-switch__description">${attrs.description}</span>
</j:if>
</span>
</j:jelly>

0 comments on commit fa35f03

Please sign in to comment.