Only displays the OK button when there is some text typed in the search box.
authorStéphane Jacob <sj@m4x.org>
Mon, 15 Jun 2009 20:40:15 +0000 (22:40 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 16 Jun 2009 07:14:17 +0000 (09:14 +0200)
templates/skin/common.title.header.tpl

index ad75c91..39b9f51 100644 (file)
                     <div>
                         <input type="text" size="20" name="quick" id="quick" class="quick_search"
                                value="{$smarty.request.quick|default:"Recherche dans l'annuaire"}"
-                               onfocus="if (this.value === 'Recherche dans l\'annuaire') this.value=''"
-                               onblur="if (this.value === '') this.value='{$smarty.request.quick|default:"Recherche dans l'annuaire"|escape:javascript}'"/>
-                        <button type="submit" onclick="if ($('#quick').val() === 'Recherche dans l\'annuaire') $('#quick').val('')">OK</button>
+                               onfocus="if (this.value === 'Recherche dans l\'annuaire') this.value='';
+                                        $('#quick_button').show()"
+                               onblur="if (this.value === '') this.value='{$smarty.request.quick|default:"Recherche dans l'annuaire"|escape:javascript}'
+                                       $('#quick_button').hide()"/>
+                        <button id="quick_button" type="submit" style="display: none"
+                                onclick="if ($('#quick').val() === 'Recherche dans l\'annuaire') $('#quick').val('')">
+                          OK
+                        </button>
                     </div>
                 </form>
                 {if $smarty.session.auth gt AUTH_PUBLIC && $smarty.session.notifs}