From 9939cea628225480c33db9749df68dbb44067655 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 26 May 2011 18:33:01 +0000 Subject: [PATCH] Atualização da biblioteca balloon-tooltips --- classesjs/classe_mapa.js | 8 ++++---- classesjs/classe_util.js | 5 +++++ classesjs/compactados/classe_mapa_compacto.js | 2 +- pacotes/balloon-tooltips/htdocs/js/balloon.js | 25 +++++++++++++++---------- pacotes/balloon-tooltips/htdocs/js/balloon.js~ | 35 ++++++++++++++--------------------- 5 files changed, 39 insertions(+), 36 deletions(-) diff --git a/classesjs/classe_mapa.js b/classesjs/classe_mapa.js index 2344221..dda30bf 100644 --- a/classesjs/classe_mapa.js +++ b/classesjs/classe_mapa.js @@ -644,7 +644,7 @@ i3GEO.mapa = { if(i3GEO.Interface.ATUAL === "googleearth") {i3GEO.Interface.googleearth.aguarde.visibility = "visible";} retorna = function(retorno){ - var temp,rfes,n,balloon,i,mostra,res,temas,ntemas,titulo,tips,j,ntips,ins,r,ds,nds,s, + var pos,temp,rfes,n,i,mostra,res,temas,ntemas,titulo,tips,j,ntips,ins,r,ds,nds,s, configura = i3GEO.configura, tipotip = configura.tipotip; i = $i("i3geo_rosa"); @@ -723,15 +723,15 @@ i3GEO.mapa = { else{ i3GEO.util.criaPin('marcaIdentifica',configura.locaplic+"/imagens/grabber.gif","12px","12px"); i3GEO.janela.TIPS.push('marcaIdentifica'); - i3GEO.util.posicionaImagemNoMapa("marcaIdentifica"); + pos = i3GEO.util.posicionaImagemNoMapa("marcaIdentifica"); balloon = new Balloon(); BalloonConfig(balloon,'GBox'); balloon.delayTime = 0; res = "
"+res+"
"; temp = $i('marcaIdentifica'); if(temp){ - - balloon.showTooltip(temp,res); + balloon.showTooltip(temp,res,null,null,null,pos[1],pos[0]); + balloon.addCloseButton(); temp.onclick = function(e){ if (!e){e = window.event;} document.body.removeChild(balloon.getEventTarget(e)); diff --git a/classesjs/classe_util.js b/classesjs/classe_util.js index bdc4fee..9c4adb1 100644 --- a/classesjs/classe_util.js +++ b/classesjs/classe_util.js @@ -662,6 +662,10 @@ i3GEO.util = { Parametros: id {string} - id do elemento que será posicionado + + Return: + + array[top,left] - valores em pixel da posição calculada da imagem */ posicionaImagemNoMapa: function(id){ if(typeof(console) !== 'undefined'){console.info("i3GEO.util.posicionaImagemNoMapa()");} @@ -672,6 +676,7 @@ i3GEO.util = { i.style.position = "absolute"; i.style.top = objposicaocursor.telay - my; i.style.left = objposicaocursor.telax - mx; + return [objposicaocursor.telay - my,objposicaocursor.telax - mx]; }, /* Function: escondePin diff --git a/classesjs/compactados/classe_mapa_compacto.js b/classesjs/compactados/classe_mapa_compacto.js index 231e385..3f128dd 100644 --- a/classesjs/compactados/classe_mapa_compacto.js +++ b/classesjs/compactados/classe_mapa_compacto.js @@ -1 +1 @@ -if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.mapa={AUTORESIZE:false,GEOXML:[],ativaAutoResize:function(){window.onresize=function(){var temp=setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");i3GEO.guias.escondeGuias()},2000)}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,imagemxref=0,imagemyref=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{$left(i3GEO.Interface.IDCORPO,imagemxi)}$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){alert("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert("Essa operação não funciona nessa interface");return}i3GEO.php.ativalogo(i3GEO.atualiza)},verifica:function(retorno){try{i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o3"));if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{alert("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaHTML:{incluiBotaoLibera:true,ID:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()")}i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg,temp=function(retorno){var s,ins,elementos,i;if(i3GEO.mapa.legendaHTML.ID!==""&&$i(i3GEO.mapa.legendaHTML.ID)){if((retorno.data!=="erro")&&(retorno.data!==undefined)){s=i3GEO.configura.locaplic+"/imagens/branco.gif";ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='

Mostra a legenda em uma janela

'}ins+="
"+retorno.data.legenda+"
";$i(i3GEO.mapa.legendaHTML.ID).innerHTML=ins}}if($i("wlegenda")){$i("wlegenda").innerHTML=retorno.data.legenda;elementos=$i("wlegenda").getElementsByTagName("input");for(i=0;iLegenda';temp+='
';novoel.innerHTML=temp;document.body.appendChild(novoel);YAHOO.namespace("moveLegi.xp");YAHOO.moveLegi.xp.panel=new YAHOO.widget.ResizePanel("moveLegi",{width:"300px",fixedcenter:true,constraintoviewport:false,underlay:"none",close:true,visible:true,draggable:true,modal:false,iframe:true});YAHOO.moveLegi.xp.panel.render()}$i("wlegenda").innerHTML=retorno.data.legenda;temp=$i("wlegenda").getElementsByTagName("input");n=temp.length;for(i=0;i   ")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico")},cliqueIdentificaDefault:function(){if(g_tipoacao==="identifica"){i3GEO.eventos.MOUSEPARADO.remove("verificaTip()");if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.identifica.criaJanelaFlutuante()","i3GEOF.identifica_script")}else{i3GEOF.identifica.x=objposicaocursor.ddx;i3GEOF.identifica.y=objposicaocursor.ddy;i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);return}}},verificaTipDefault:function(){var ntemas,etiquetas,j,retorna;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j"+titulo+"
"}else{titulo=""}tips=(temas[j].resultado.tips).split(",");ntips=tips.length;ins="";ds=temas[j].resultado.dados;if(ds!==" "){try{nds=ds.length;for(s=0;s"+alias+" :"+valor+"
"}if(valor!==""&&link!==""){ins+=""+alias+" : "+valor+"
"}if(img!==""){ins+=img+"
"}ins+="";mostra=true}else{ins+=""+valor+"
";mostra=true}}catch(e){}}}}catch(e){}}if(ins!==""){res+=titulo+ins}}if(!mostra){if($i("tip")){$i("tip").style.display="none"}}else{if(tipotip!=="balao"){n=i3GEO.janela.tip();$i(n).style.textAlign="left";$i(n).innerHTML+=res}else{if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.balao(res,objposicaocursor.ddx,objposicaocursor.ddy);i3GEO.Interface.googleearth.aguarde.visibility="hidden"}else{i3GEO.util.criaPin('marcaIdentifica',configura.locaplic+"/imagens/grabber.gif","12px","12px");i3GEO.janela.TIPS.push('marcaIdentifica');i3GEO.util.posicionaImagemNoMapa("marcaIdentifica");balloon=new Balloon();BalloonConfig(balloon,'GBox');balloon.delayTime=0;res="
"+res+"
";temp=$i('marcaIdentifica');if(temp){balloon.showTooltip($i("marcaIdentifica"),res);temp.onclick=function(e){if(!e){e=window.event}document.body.removeChild(balloon.getEventTarget(e))}}}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";if(i3GEO.Interface.ATIVAMENUCONTEXTO){temp="identifica_contexto"}i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica2(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5","tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; \ No newline at end of file +if(typeof(i3GEO)==='undefined'){i3GEO=[]}i3GEO.mapa={AUTORESIZE:false,GEOXML:[],ativaAutoResize:function(){window.onresize=function(){var temp=setTimeout(function(){i3GEO.reCalculaTamanho();i3GEO.barraDeBotoes.recria("i3geo_barra2");i3GEO.guias.escondeGuias()},2000)}},ajustaPosicao:function(elemento){if(arguments.length===0){return}var imagemxi=0,imagemyi=0,imagemxref=0,imagemyref=0,dc=$i(elemento),c;if(!dc){return}try{while((dc.offsetParent)&&(dc.offsetParent.id!=="i3geo")){dc=dc.offsetParent;imagemxi+=dc.offsetLeft;imagemyi+=dc.offsetTop}c=$i(i3GEO.Interface.IDCORPO);if(c){c.style.position="absolute";if(navm){$left(i3GEO.Interface.IDCORPO,imagemxi-1)}else{$left(i3GEO.Interface.IDCORPO,imagemxi)}$top(i3GEO.Interface.IDCORPO,imagemyi)}}catch(e){alert("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e)}},ativaTema:function(codigo){if(i3GEO.temaAtivo!==""){i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","")}i3GEO.temaAtivo=codigo;i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown")},ativaLogo:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){alert("Essa operação não funciona nessa interface");return}i3GEO.php.ativalogo(i3GEO.atualiza)},verifica:function(retorno){try{i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o3"));if(retorno.data){retorno=retorno.data}if(retorno.variaveis){retorno=retorno.variaveis}if((retorno==="erro")||(typeof(retorno)==='undefined')){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();i3GEO.mapa.recupera.inicia()}i3GEO.mapa.recupera.TENTATIVA=0}catch(e){if(i3GEO.Interface.ATUAL==="openlayers"||i3GEO.Interface.ATUAL==="googlemaps"){i3GEO.janela.fechaAguarde();return}if(this.recupera.TENTATIVA===0){alert("Erro no mapa. Sera feita uma tentativa de recuperacao.");i3GEO.mapa.recupera.inicia()}else{alert("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa.");if(this.recupera.TENTATIVA===1){this.recupera.TENTATIVA=2;i3GEO.php.reiniciaMapa(i3GEO.atualiza)}}}},recupera:{TENTATIVA:0,inicia:function(){i3GEO.mapa.ajustaPosicao();i3GEO.janela.fechaAguarde();if(this.recupera.TENTATIVA===0){this.recupera.TENTATIVA++;this.recupera.restaura()}},restaura:function(){i3GEO.php.recuperamapa(i3GEO.atualiza)}},legendaHTML:{incluiBotaoLibera:true,ID:"",cria:function(id){if(arguments.length===0){id=""}i3GEO.mapa.legendaHTML.ID=id;if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()")<0){i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()")}i3GEO.mapa.legendaHTML.atualiza()},atualiza:function(){var idleg,temp=function(retorno){var s,ins,elementos,i;if(i3GEO.mapa.legendaHTML.ID!==""&&$i(i3GEO.mapa.legendaHTML.ID)){if((retorno.data!=="erro")&&(retorno.data!==undefined)){s=i3GEO.configura.locaplic+"/imagens/branco.gif";ins="";if(i3GEO.mapa.legendaHTML.incluiBotaoLibera===true){ins+='

Mostra a legenda em uma janela

'}ins+="
"+retorno.data.legenda+"
";$i(i3GEO.mapa.legendaHTML.ID).innerHTML=ins}}if($i("wlegenda")){$i("wlegenda").innerHTML=retorno.data.legenda;elementos=$i("wlegenda").getElementsByTagName("input");for(i=0;iLegenda';temp+='
';novoel.innerHTML=temp;document.body.appendChild(novoel);YAHOO.namespace("moveLegi.xp");YAHOO.moveLegi.xp.panel=new YAHOO.widget.ResizePanel("moveLegi",{width:"300px",fixedcenter:true,constraintoviewport:false,underlay:"none",close:true,visible:true,draggable:true,modal:false,iframe:true});YAHOO.moveLegi.xp.panel.render()}$i("wlegenda").innerHTML=retorno.data.legenda;temp=$i("wlegenda").getElementsByTagName("input");n=temp.length;for(i=0;i   ")},tamanho:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho")},tipoimagem:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem")},corFundo:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo")},opcoesEscala:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala")},opcoesLegenda:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda")},gradeCoord:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord")},cliqueTexto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt")},selecao:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao")},cliquePonto:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy")},cliqueGrafico:function(){i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico")},cliqueIdentificaDefault:function(){if(g_tipoacao==="identifica"){i3GEO.eventos.MOUSEPARADO.remove("verificaTip()");if(typeof(i3GEOF.identifica)==='undefined'){var js=i3GEO.configura.locaplic+"/ferramentas/identifica/index.js.php";i3GEO.util.scriptTag(js,"i3GEOF.identifica.criaJanelaFlutuante()","i3GEOF.identifica_script")}else{i3GEOF.identifica.x=objposicaocursor.ddx;i3GEOF.identifica.y=objposicaocursor.ddy;i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo);return}}},verificaTipDefault:function(){var ntemas,etiquetas,j,retorna;ntemas=i3GEO.arvoreDeCamadas.CAMADAS.length;etiquetas=false;for(j=0;j"+titulo+"
"}else{titulo=""}tips=(temas[j].resultado.tips).split(",");ntips=tips.length;ins="";ds=temas[j].resultado.dados;if(ds!==" "){try{nds=ds.length;for(s=0;s"+alias+" :"+valor+"
"}if(valor!==""&&link!==""){ins+=""+alias+" : "+valor+"
"}if(img!==""){ins+=img+"
"}ins+="";mostra=true}else{ins+=""+valor+"
";mostra=true}}catch(e){}}}}catch(e){}}if(ins!==""){res+=titulo+ins}}if(!mostra){if($i("tip")){$i("tip").style.display="none"}}else{if(tipotip!=="balao"){n=i3GEO.janela.tip();$i(n).style.textAlign="left";$i(n).innerHTML+=res}else{if(i3GEO.Interface.ATUAL==="googleearth"){i3GEO.Interface.googleearth.balao(res,objposicaocursor.ddx,objposicaocursor.ddy);i3GEO.Interface.googleearth.aguarde.visibility="hidden"}else{i3GEO.util.criaPin('marcaIdentifica',configura.locaplic+"/imagens/grabber.gif","12px","12px");i3GEO.janela.TIPS.push('marcaIdentifica');pos=i3GEO.util.posicionaImagemNoMapa("marcaIdentifica");balloon=new Balloon();BalloonConfig(balloon,'GBox');balloon.delayTime=0;res="
"+res+"
";temp=$i('marcaIdentifica');if(temp){balloon.showTooltip(temp,res,null,null,null,pos[1],pos[0]);balloon.addCloseButton();temp.onclick=function(e){if(!e){e=window.event}document.body.removeChild(balloon.getEventTarget(e));balloon.hideTooltip()}}}}}}if($i(i3GEO.Interface.IDMAPA)){$i(i3GEO.Interface.IDMAPA).title="";temp="identifica";if(i3GEO.Interface.ATIVAMENUCONTEXTO){temp="identifica_contexto"}i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic)}};i3GEO.php.identifica2(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5","tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten)}}}; \ No newline at end of file diff --git a/pacotes/balloon-tooltips/htdocs/js/balloon.js b/pacotes/balloon-tooltips/htdocs/js/balloon.js index 24f9e4d..0ea8569 100644 --- a/pacotes/balloon-tooltips/htdocs/js/balloon.js +++ b/pacotes/balloon-tooltips/htdocs/js/balloon.js @@ -77,7 +77,7 @@ var Balloon = function () { // This is the method that is called on mouseover. It has a built-in // // delay time to avoid balloons popping up on rapid mouseover events // ////////////////////////////////////////////////////////////////////////// -Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height) { +Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height,x,y) { // If the objext is not configured by now, fall back to default if (!this.configured) { BalloonConfig(this,'GBubble'); @@ -202,6 +202,9 @@ Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height) { this.width = width; this.height = height; this.actualWidth = null; + //edmar + this.x = x; + this.y = y; // make sure old balloons are removed this.hideTooltip(); @@ -283,6 +286,7 @@ Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height) { // Make delay time short for onmousedown //var delay = mouseOver ? this.delayTime : 1; //this.timeoutTooltip = window.setTimeout(this.doShowTooltip,delay); + balloon.setActiveCoordinates([]); this.doShowTooltip(); this.pending = true; } @@ -368,7 +372,7 @@ Balloon.prototype.doShowTooltip = function() { // close control for balloon or box if (balloonIsSticky) { - self.addCloseButton(); + self.addCloseButton(); } balloonIsVisible = true; @@ -379,6 +383,7 @@ Balloon.prototype.doShowTooltip = function() { self.startX = self.activeLeft; self.startY = self.activeTop; + self.fade(0,self.opacity,self.fadeIn); } @@ -396,6 +401,9 @@ Balloon.prototype.addCloseButton = function () { closeButton.setAttribute('src',self.closeButton); closeButton.onclick = function() { Balloon.prototype.nukeTooltip(); + var temp = $i('marcaIdentifica'); + if(temp) + {temp.parentNode.removeChild(temp);} }; self.setStyle(closeButton,'position','absolute'); document.body.appendChild(closeButton); @@ -520,6 +528,7 @@ Balloon.prototype.setBalloonStyle = function(vOrient,hOrient,pageWidth,pageLeft) if (this.stem) { var stem = document.createElement('img'); + stem.style.zIndex = 50000; self.setStyle(stem,'position','absolute'); balloon.appendChild(stem); @@ -747,7 +756,7 @@ Balloon.prototype.hideTooltip = function(override) { // Garbage collection Balloon.prototype.cleanup = function() { var self = currentBalloonClass; - var body; + var body; if (self) { body = self.parent ? self.parent : self.parentID ? document.getElementById(self.parentID) || document.body @@ -756,13 +765,13 @@ Balloon.prototype.cleanup = function() { else { body = document.body; } - var bubble = document.getElementById('visibleBalloonElement'); var close = document.getElementById('closeButton'); var cont = document.getElementById('balloonPreloadContainer'); if (bubble) { body.removeChild(bubble) } if (close) { body.removeChild(close) } if (cont) { body.removeChild(cont) } + //edmar } @@ -789,10 +798,6 @@ Balloon.prototype.setActiveCoordinates = function(evt) { if (!evt) { return true; } - // - //modificado por edmar - // - self.currentEvent = {}; for (var i in evt) { self.currentEvent[i] = evt[i]; @@ -806,7 +811,8 @@ Balloon.prototype.setActiveCoordinates = function(evt) { var scrollTop = 0; var scrollLeft = 0; - var XY = self.eventXY(evt); + //var XY = self.eventXY(evt); + var XY = [self.x,self.y]; adjustment = self.hOffset < 20 ? 10 : 0; self.activeTop = scrollTop + XY[1] - adjustment - self.vOffset - self.stemHeight; self.activeLeft = scrollLeft + XY[0] - adjustment - self.hOffset; @@ -854,7 +860,6 @@ Balloon.prototype.setActiveCoordinates = function(evt) { } } } - return true; } diff --git a/pacotes/balloon-tooltips/htdocs/js/balloon.js~ b/pacotes/balloon-tooltips/htdocs/js/balloon.js~ index 7ea1400..c9bbe25 100644 --- a/pacotes/balloon-tooltips/htdocs/js/balloon.js~ +++ b/pacotes/balloon-tooltips/htdocs/js/balloon.js~ @@ -77,7 +77,7 @@ var Balloon = function () { // This is the method that is called on mouseover. It has a built-in // // delay time to avoid balloons popping up on rapid mouseover events // ////////////////////////////////////////////////////////////////////////// -Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height) { +Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height,x,y) { // If the objext is not configured by now, fall back to default if (!this.configured) { BalloonConfig(this,'GBubble'); @@ -202,6 +202,9 @@ Balloon.prototype.showTooltip = function(evt,caption,sticky,width,height) { this.width = width; this.height = height; this.actualWidth = null; + //edmar + this.x = x; + this.y = y; // make sure old balloons are removed this.hideTooltip(); @@ -368,7 +371,7 @@ Balloon.prototype.doShowTooltip = function() { // close control for balloon or box if (balloonIsSticky) { - self.addCloseButton(); + self.addCloseButton(); } balloonIsVisible = true; @@ -379,6 +382,7 @@ Balloon.prototype.doShowTooltip = function() { self.startX = self.activeLeft; self.startY = self.activeTop; + self.fade(0,self.opacity,self.fadeIn); } @@ -396,6 +400,9 @@ Balloon.prototype.addCloseButton = function () { closeButton.setAttribute('src',self.closeButton); closeButton.onclick = function() { Balloon.prototype.nukeTooltip(); + var temp = $i('marcaIdentifica'); + if(temp) + {temp.parentNode.removeChild(temp);} }; self.setStyle(closeButton,'position','absolute'); document.body.appendChild(closeButton); @@ -520,6 +527,7 @@ Balloon.prototype.setBalloonStyle = function(vOrient,hOrient,pageWidth,pageLeft) if (this.stem) { var stem = document.createElement('img'); + stem.style.zIndex = 50000; self.setStyle(stem,'position','absolute'); balloon.appendChild(stem); @@ -747,7 +755,7 @@ Balloon.prototype.hideTooltip = function(override) { // Garbage collection Balloon.prototype.cleanup = function() { var self = currentBalloonClass; - var body; + var body; if (self) { body = self.parent ? self.parent : self.parentID ? document.getElementById(self.parentID) || document.body @@ -756,13 +764,13 @@ Balloon.prototype.cleanup = function() { else { body = document.body; } - var bubble = document.getElementById('visibleBalloonElement'); var close = document.getElementById('closeButton'); var cont = document.getElementById('balloonPreloadContainer'); if (bubble) { body.removeChild(bubble) } if (close) { body.removeChild(close) } if (cont) { body.removeChild(cont) } + //edmar } @@ -789,21 +797,6 @@ Balloon.prototype.setActiveCoordinates = function(evt) { if (!evt) { return true; } - // - //modificado por edmar - // - alert(evt.id) - try{ - if(typeof(evt.id) == "string") - { - var pos = i3GEO.util.pegaPosicaoObjeto(event); - self.activeTop = pos[1] - 10; - self.activeLeft = pos[0] - 10; - self.activeRight = self.activeLeft + 20; - self.activeBottom = self.activeTop + 20; - return true; - } - }catch(e){} self.currentEvent = {}; for (var i in evt) { self.currentEvent[i] = evt[i]; @@ -817,7 +810,8 @@ Balloon.prototype.setActiveCoordinates = function(evt) { var scrollTop = 0; var scrollLeft = 0; - var XY = self.eventXY(evt); + //var XY = self.eventXY(evt); + var XY = [self.x,self.y]; adjustment = self.hOffset < 20 ? 10 : 0; self.activeTop = scrollTop + XY[1] - adjustment - self.vOffset - self.stemHeight; self.activeLeft = scrollLeft + XY[0] - adjustment - self.hOffset; @@ -865,7 +859,6 @@ Balloon.prototype.setActiveCoordinates = function(evt) { } } } - return true; } -- libgit2 0.21.2