1
0
forked from qwerty/milfs

mejoras en campo buscador

This commit is contained in:
humano 2018-12-08 12:05:36 -05:00
parent 3922a70f01
commit 3f8cb0a5ac
3 changed files with 33 additions and 2 deletions

View File

@ -694,3 +694,9 @@ Help-tip Style
0% { opacity:0; }
100% { opacity:100%; }
}
.blink{
color: rgb (0, 137, 226);
animation: blink 1s infinite;
}

View File

@ -11227,12 +11227,18 @@ $xajax->registerFunction("buscador_select_base");
function buscador_campo($id_campo,$form_id,$valor,$name,$control,$tipo){
$div ="div_buscador_$name";
$onchange = " xajax_buscador_select('$id_campo','$form_id',(this.value),'$name','$control','$tipo'); document.getElementById('$name').value='';";
//$onchange = " delay(xajax_buscador_select('$id_campo','$form_id',(this.value),'$name','$control','$tipo'),'10500'); document.getElementById('$name').value='';";
//$onchange = " delay(xajax_buscador_select('$id_campo','$form_id',(document.getElementById('buscador_$name').value),'$name','$control','$tipo'),'10500'); document.getElementById('$name').value='';";
$onchange = " delayFunction(function() { javascript:xajax_buscador_select('$id_campo','$form_id',(document.getElementById('buscador_$name').value),'$name','$control','$tipo')},10); ; document.getElementById('$name').value='';";
$onclick = " xajax_buscador_select('$id_campo','$form_id','','$name','$control','$tipo'); document.getElementById('$name').value=''; (this).value='';";
$resultado ="
<input class='form-control' name='buscador_$name' id='buscador_$name' onclick= \"$onclick \" onkeyup=\"$onchange\" >
<input type='hidden' class='form-control' name='$name' id='$name' >
<div class='text-left container-fluid alert-info' style='position:absolute !important; padding;5px; z-index:1500 !important;'><div id='$div' ></div>$valor</div>";
<div class='text-left container-fluid alert-info' style='position:absolute !important; padding;5px; z-index:1500 !important;'><div id='$div' ></div>$valor</div>
";
return $resultado;
}
@ -11309,11 +11315,18 @@ $claves = $claves[0];
}
function buscador_select($id_campo,$form_id,$valor,$name,$control,$tipo){
$div ="div_buscador_$name";
$lista="";
$resultado="";
$aviso="";
$cantidad= 4;
$respuesta = new xajaxResponse('utf-8');
if(strlen($valor) < $cantidad+1) {
$respuesta->addAssign("$div","innerHTML","<span class='blink'>... </span> Esperando mas de $cantidad caracteres");
return $respuesta;
}
if($valor=="") {
$resultado="";
$respuesta->addAssign("$div","innerHTML","$resultado");

View File

@ -1,3 +1,15 @@
function delayTimer() {
var timer;
return function (fun, time) {
clearTimeout(timer);
timer = setTimeout(fun, time);
};
}
var delayFunction = delayTimer();
function revisarSession(){
tiempo = "30";
gavela="19";