Separate function for clearing input.

This commit is contained in:
Michal Čihař
2010-04-02 13:14:45 +02:00
parent 6f602b6777
commit 4b79515d00
2 changed files with 11 additions and 1 deletions

View File

@@ -173,6 +173,16 @@ function fast_filter(value){
document.getElementById('fast_filter').disabled=false; document.getElementById('fast_filter').disabled=false;
} }
/**
* Clears fast filter.
*/
function clear_fast_filter() {
var elm = jQuery('#NavFilter input');
elm.val('');
fast_filter('');
elm.focus();
}
/* Performed on load */ /* Performed on load */
jQuery(document).ready(function(){ jQuery(document).ready(function(){
/* Display filter */ /* Display filter */

View File

@@ -318,7 +318,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
?> ?>
<span id="NavFilter" style="display:none;"> <span id="NavFilter" style="display:none;">
<span <span
onclick="document.getElementById('fast_filter').value=''; fast_filter('');document.getElementById('fast_filter').focus();" onclick="clear_fast_filter();"
style="background:white;color:black;cursor:pointer;padding:2px;margin:0 0 0 -20px;position:relative;float:right;" style="background:white;color:black;cursor:pointer;padding:2px;margin:0 0 0 -20px;position:relative;float:right;"
title="<?php echo $strReset; ?>">X</span> title="<?php echo $strReset; ?>">X</span>
<input type="text" name="fast_filter" id="fast_filter" <input type="text" name="fast_filter" id="fast_filter"