diff --git a/html/js/infobulle.js b/html/js/infobulle.js index b91744b65..dc28cbb61 100644 --- a/html/js/infobulle.js +++ b/html/js/infobulle.js @@ -94,9 +94,13 @@ function displaySelectBox(p_name) { } newDiv.innerHTML=id$("select_box"+p_name).innerHTML; var viewport = document.viewport.getDimensions(); + let div_height=newDiv.getHeight(); + if ( div_height > window.innerHeight) { + div_height = window.innerHeight / 2; + } var locPosY=posY; - if ( posY+offsetY+ newDiv.getHeight() > window.innerHeight -3) { - locPosY-=newDiv.getHeight()+20 + if ( posY+offsetY+ div_height > window.innerHeight -3) { + locPosY-=div_height+20 } newDiv.style.top=locPosY+"px"; @@ -112,7 +116,7 @@ function displaySelectBox(p_name) { id$("search_"+p_name+"_t_list").focus(); } } catch(e) { - alert(e.message); + console.error(e.message); } } diff --git a/include/lib/select_box.class.php b/include/lib/select_box.class.php index 8c6cb4817..38d1395de 100644 --- a/include/lib/select_box.class.php +++ b/include/lib/select_box.class.php @@ -156,17 +156,17 @@ class Select_Box { if ($this->item[$i]['type']=="url") { - printf('
  • %s
  • ', $this->item[$i]['url'], $this->item[$i]['label']); + printf('
  • %s
  • ', $this->item[$i]['url'], $this->item[$i]['label']); } else // For javascript if ($this->item[$i]['type']=="javascript") { - printf('
  • %s
  • ', $this->item[$i]['javascript'], + printf('
  • %s
  • ', $this->item[$i]['javascript'], $this->item[$i]['label']); } else if ($this->item[$i]['type']=="value") { - printf('
  • %s
  • ', $this->item[$i]['javascript'], + printf('
  • %s
  • ', $this->item[$i]['javascript'], $this->item[$i]['label']); } else if ($this->item[$i]['type']=="input") diff --git a/scenario/LIB/select-box-test.php b/scenario/LIB/select-box-test.php index a739d0213..0e9b64922 100644 --- a/scenario/LIB/select-box-test.php +++ b/scenario/LIB/select-box-test.php @@ -3,69 +3,7 @@