x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<div class='button-container'>
<button name="button" type="button" class="primary-button regular-button " onclick="displayAnimation(this, 'regular-button-loading-animation')" id="regular-button"><span class="primary-button-icon left-button-icon hide"></span>
<div>Login</div>
<span class="primary-button-icon right-button-icon hide"></span></button>
</div>
<div class="animation-container " id="regular-button-loading-animation">
<div class="lds-ellipsis">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<script type='text/javascript'>
//<![CDATA[
function displayAnimation(element, loadingId){
const loading = document.getElementById(loadingId)
element.style.display = 'none';
loading.style.display = 'flex';
}
document.addEventListener('turbo:submit-end', function(event) {
const loading = document.getElementById('regular-button-loading-animation')
const button = document.getElementById('regular-button')
button.style.display = 'flex';
loading.style.display = 'none';
});
//]]>
</script>
1
render Buttons::RegularButtonComponent.new(id:'regular-button', value: "Login", variant: "primary")