Commit 21fc4a03eec60122126f8d7b80f25371186f66f6
1 parent
8cd739df
Exists in
master
implementa filtro na lista de servicos por javascript
Showing
2 changed files
with
25 additions
and
1 deletions
Show diff stats
Fila-Web/root/header.tt
... | ... | @@ -67,6 +67,29 @@ function set_timeout(tempo, motivo, callback) { |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | +function aplicar_filtro_servicos(text) { | |
71 | + var rx; | |
72 | + if (text) { | |
73 | + rx = new RegExp(text,"i"); | |
74 | + } | |
75 | + var servicos = $$('#servicos ul li ul li'); | |
76 | + var len = servicos.length; | |
77 | + var index = 0; | |
78 | + for (index = 0; index < len; ++index) { | |
79 | + var item = servicos[index]; | |
80 | + if (text) { | |
81 | + var value = item.firstChild.data; | |
82 | + if (value.match(rx) == null) { | |
83 | + item.addClassName('escondido'); | |
84 | + } else { | |
85 | + item.removeClassName('escondido'); | |
86 | + } | |
87 | + } else { | |
88 | + item.removeClassName('escondido'); | |
89 | + } | |
90 | + } | |
91 | +} | |
92 | + | |
70 | 93 | </script> |
71 | 94 | </HEAD> |
72 | 95 | <BODY onload='disconnected_so_move_away()'> | ... | ... |
Fila-Web/root/render/status_atendente.tt
... | ... | @@ -57,7 +57,8 @@ |
57 | 57 | |
58 | 58 | [% IF status_guiche.guiche.estado == 'concluido' || status_guiche.guiche.estado == 'disponivel' %] |
59 | 59 | [% IF lista_servicos %] |
60 | - <h3 id="TitServicos" class="titulos">Serviços:</h3><br> | |
60 | + <h3 id="TitServicos" class="titulos">Serviços (utilize o campo para filtrar):</h3><br> | |
61 | + <INPUT TYPE="text" NAME="filter" ONKEYUP="apply_filter(this.value)" /> | |
61 | 62 | <DIV ID="servicos"> |
62 | 63 | <UL> |
63 | 64 | [% SET classe_servico = 0 %] | ... | ... |