Commit f103fb03 by Thibault Grandjean

add spinner autocomplete

parent 38dee935
...@@ -112,3 +112,7 @@ ...@@ -112,3 +112,7 @@
text-align: center; text-align: center;
font-size: 1.6rem; font-size: 1.6rem;
} }
.spinner {
height:40px;
}
...@@ -228,6 +228,12 @@ $(document).ready(function() { ...@@ -228,6 +228,12 @@ $(document).ready(function() {
) )
}, },
minLength: 1, minLength: 1,
search: function(event, ui) {
$('#spinner1').show();
},
response: function(event, ui) {
$('#spinner1').hide();
},
select: function( event, ui ) { select: function( event, ui ) {
event.preventDefault(); event.preventDefault();
if (ui.item) { if (ui.item) {
...@@ -273,6 +279,12 @@ $(document).ready(function() { ...@@ -273,6 +279,12 @@ $(document).ready(function() {
) )
}, },
minLength: 1, minLength: 1,
search: function(event, ui) {
$('#spinner2').show();
},
response: function(event, ui) {
$('#spinner2').hide();
},
select: function( event, ui ) { select: function( event, ui ) {
if (ui.item) { if (ui.item) {
load_member_infos("childInfo", ui.item.value) load_member_infos("childInfo", ui.item.value)
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<h4>Rechercher le.a coopérateur.ice titulaire</h4> <h4>Rechercher le.a coopérateur.ice titulaire</h4>
<form autocomplete="off" id="search_member_form" class="search_member_form" action="javascript:;" method="post"> <form autocomplete="off" id="search_member_form" class="search_member_form" action="javascript:;" method="post">
<input name="searchParent" type="text" id="search_member_input" value="" placeholder="Nom ou numéro du coop..." required> <input name="searchParent" type="text" id="search_member_input" value="" placeholder="Nom ou numéro du coop..." required>
<img id="spinner1" class="spinner" src="{% static 'img/Loading_2.gif' %}" alt="loading" style="display:none;">
</form> </form>
</div> </div>
<div id="parentInfo" style="display:none;"> <div id="parentInfo" style="display:none;">
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
<h4>Rechercher le.a coopérateur.ice suppléant.e</h4> <h4>Rechercher le.a coopérateur.ice suppléant.e</h4>
<form autocomplete="off" id="search_member_form_child" class="search_member_form" action="javascript:;" method="post"> <form autocomplete="off" id="search_member_form_child" class="search_member_form" action="javascript:;" method="post">
<input name="searchChild" type="text" id="search_child_input" value="" placeholder="Nom ou numéro du coop..." required> <input name="searchChild" type="text" id="search_child_input" value="" placeholder="Nom ou numéro du coop..." required>
<img id="spinner2" class="spinner" src="{% static 'img/Loading_2.gif' %}" alt="loading" style="display:none;">
</form> </form>
</div> </div>
<div id="childInfo" style="display:none;"> <div id="childInfo" style="display:none;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment