Skip to content

Commit

Permalink
Animate in/out radio children
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Oct 10, 2021
1 parent 138fe14 commit 281b2bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
14 changes: 7 additions & 7 deletions core/src/main/resources/lib/hudson/newFromList/form.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ THE SOFTWARE.
<div class="jenkins-radio">
<input class="jenkins-radio__input" type="radio" id="copy" name="mode" value="copy" onchange="updateOk()" onclick="updateOk()" />
<label class="jenkins-radio__label" for="copy">${attrs.copyTitle}</label>
</div>
<s:entry class="jenkins-radio__children">
<j:set var="descriptor" value="${it.descriptor}" />
<div class="jenkins-search">
<s:textbox id="from" placeholder="Type for suggestions" clazz="jenkins-search__input" name="from" field="copyNewItemFrom" onfocus="$('copy').click()" />
<l:svgIcon href="${resURL}/images/material-icons/svg-sprite-action-symbol.svg#ic_search_24px" class="jenkins-search__icon" />
<div class="jenkins-radio__children">
<j:set var="descriptor" value="${it.descriptor}" />
<div class="jenkins-search">
<s:textbox placeholder="Type for suggestions" clazz="jenkins-search__input" name="from" field="copyNewItemFrom" onfocus="$('copy').click()" />
<l:svgIcon href="${resURL}/images/material-icons/svg-sprite-action-symbol.svg#ic_search_24px" class="jenkins-search__icon" />
</div>
</div>
</s:entry>
</div>
</j:if>
</fieldset>
</div>
Expand Down
15 changes: 13 additions & 2 deletions war/src/main/less/modules/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

.jenkins-search {
position: relative;
max-width: 420px;

&__input {
appearance: none;
Expand All @@ -65,7 +66,6 @@
border: 2px solid var(--input-border);
border-radius: 6px;
width: 100%;
max-width: 350px;
margin: 0;
padding: 0 4px 0 29px;
line-height: 30px;
Expand Down Expand Up @@ -236,8 +236,12 @@

&__children {
position: relative;
margin-top: -10px;
margin-top: 0;
opacity: 0;
padding-left: 32px;
transition: 0.2s ease;
visibility: hidden;
max-height: 0;

&::after {
content: "";
Expand All @@ -257,6 +261,13 @@
}
}
}

&__input:checked + &__label + &__children {
visibility: visible;
margin-top: 10px;
opacity: 1;
max-height: none;
}
}

.jenkins-button {
Expand Down

0 comments on commit 281b2bd

Please sign in to comment.