noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 137/219: Infobulle : avoid that the info ball


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 137/219: Infobulle : avoid that the info balloon exceed limit of the display
Date: Mon, 18 Dec 2017 13:22:51 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 066b970f110aa0fa9008846d32b459cc0e89f1a2
Author: Dany De Bontridder <address@hidden>
Date:   Sat Nov 4 09:33:53 2017 +0100

    Infobulle : avoid that the info balloon exceed limit of the display
---
 html/js/infobulle.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/html/js/infobulle.js b/html/js/infobulle.js
index 1167c12..381a369 100644
--- a/html/js/infobulle.js
+++ b/html/js/infobulle.js
@@ -29,6 +29,9 @@ document.onmousemove=getPosition;
 
 function showBulle(p_ctl){
     var d=document.getElementById('bulle');
+    var viewport = document.viewport.getDimensions();
+    if ( posX+offsetX > viewport.width-d.getWidth()) { posX-=d.getWidth()+20;}
+    if ( posY+offsetY > viewport.height-d.getHeight()-20) { 
posY-=d.getHeight()+20}
     d.innerHTML=content[p_ctl];
     d.style.top=posY+offsetY+"px";
     d.style.left=posX+offsetX-10+"px";
@@ -57,6 +60,7 @@ function displayBulle(p_comment)  {
     var viewport = document.viewport.getDimensions();
     d.innerHTML=p_comment;
     if ( posX+offsetX > viewport.width-d.getWidth()) { posX-=d.getWidth()+20;}
+    if ( posY+offsetY > viewport.height-d.getHeight()-20) { 
posY-=d.getHeight()+20}
     d.style.top=posY+offsetY+"px";
     d.style.left=posX+offsetX+"px";
     d.style.visibility="visible";



reply via email to

[Prev in Thread] Current Thread [Next in Thread]