From b86073529a2b811eab92eec7f510f7a1d86db74a Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 2 Aug 2011 02:14:02 +0000 Subject: [PATCH] Corrige erro que não permitia a eliminação de elementos gráficos no editor vetorial ao ser removido da tela --- classesjs/classe_barradebotoes.js | 21 +++++++++++---------- classesjs/classe_eventos.js | 6 +++--- classesjs/classe_gadgets.js | 38 ++++++++++++++++++-------------------- classesjs/classe_interface.js | 4 +--- interface/openlayers.htm | 2 +- mashups/openlayers.js.php | 18 +++++++++++++++--- 6 files changed, 49 insertions(+), 40 deletions(-) diff --git a/classesjs/classe_barradebotoes.js b/classesjs/classe_barradebotoes.js index dc91161..5c22c9f 100644 --- a/classesjs/classe_barradebotoes.js +++ b/classesjs/classe_barradebotoes.js @@ -1286,8 +1286,8 @@ i3GEO.barraDeBotoes = { }, mostraJanela: function(objeto,mensagem,evt){ if(mensagem === ""){ - try{clearTimeout(timeMostraAjudaBotoes);}catch(e){} - try{clearTimeout(timeAjudaBotoes);}catch(e){} + try{clearTimeout(i3GEO.barraDeBotoes.timeMostraAjudaBotoes);}catch(e){} + try{clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);}catch(e){} return; } var divmensagem = $i("divMensagemBarraDeBotoes"),balloonAjuda, @@ -1327,8 +1327,8 @@ i3GEO.barraDeBotoes = { divmensagem.style.left = (parseInt(YAHOO.util.Dom.getStyle(objeto,"width"),10)/2)+pos[0]-5+"px"; divmensagem.style.top = pos[1]+5+parseInt(YAHOO.util.Dom.getStyle(objeto,"height"),10)+"px"; } - try{clearTimeout(timeAjudaBotoes);}catch(e){} - timeMostraAjudaBotoes = setTimeout("i3GEO.barraDeBotoes.mostraJanelaAjuda('"+mensagem+"');",5000); + try{clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);}catch(e){} + i3GEO.barraDeBotoes.timeMostraAjudaBotoes = setTimeout("i3GEO.barraDeBotoes.mostraJanelaAjuda('"+mensagem+"');",5000); } else{ hideAllTooltips(); @@ -1340,8 +1340,8 @@ i3GEO.barraDeBotoes = { balloonAjuda.vOffset = -24; balloonAjuda.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GBubblec'; mensagem = "
fecha
"+mensagem+"
"; - try{clearTimeout(timeAjudaBotoes);}catch(e){} - timeMostraAjudaBotoes = setTimeout(function(){ + try{clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);}catch(e){} + i3GEO.barraDeBotoes.timeMostraAjudaBotoes = setTimeout(function(){ balloonAjuda.cleanup(); balloonIsVisible = false; //alert(mensagem); @@ -1350,7 +1350,7 @@ i3GEO.barraDeBotoes = { else {balloonAjuda.showTooltip(objeto,mensagem,null,null,null,pos[0]+12,pos[1]);} try{clearTimeout(timeMostraAjudaBotoes);}catch(e){} - timeAjudaBotoes = setTimeout(function(){balloonAjuda.cleanup();},4000); + i3GEO.barraDeBotoes.timeAjudaBotoes = setTimeout(function(){balloonAjuda.cleanup();},4000); },4000); } } @@ -1358,12 +1358,13 @@ i3GEO.barraDeBotoes = { mostraJanelaAjuda:function(mensagem){ $i("divMensagemBarraDeBotoesCorpo").innerHTML = mensagem; YAHOO.util.Dom.setStyle("divMensagemBarraDeBotoes","display","block"); - try{clearTimeout(timeMostraAjudaBotoes);}catch(e){} - timeAjudaBotoes = setTimeout(function(){i3GEO.barraDeBotoes.escondeJanelaAjuda();},3000); + try{clearTimeout(i3GEO.barraDeBotoes.timeMostraAjudaBotoes);}catch(e){} + i3GEO.barraDeBotoes.timeAjudaBotoes = setTimeout(function(){i3GEO.barraDeBotoes.escondeJanelaAjuda();},3000); }, escondeJanelaAjuda:function(){ try{ - clearTimeout(timeAjudaBotoes); + if(i3GEO.barraDeBotoes.timeAjudaBotoes) + {clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);} } catch(e){} if($i("divMensagemBarraDeBotoes")) diff --git a/classesjs/classe_eventos.js b/classesjs/classe_eventos.js index 268f181..0946832 100644 --- a/classesjs/classe_eventos.js +++ b/classesjs/classe_eventos.js @@ -56,13 +56,13 @@ Exemplos: Para incluir uma função em um determinado evento utilize - if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaNumerica()") < 0) + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.gadgets.atualizaEscalaNumerica()") < 0) - {i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaNumerica()");} + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.gadgets.atualizaEscalaNumerica()");} Para remover utilize - i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaNumerica()"); + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.gadgets.atualizaEscalaNumerica()"); */ i3GEO.eventos = { /* diff --git a/classesjs/classe_gadgets.js b/classesjs/classe_gadgets.js index 82622cc..2009429 100644 --- a/classesjs/classe_gadgets.js +++ b/classesjs/classe_gadgets.js @@ -242,23 +242,6 @@ i3GEO.gadgets = { if(onde){ if(onde.style.display == "none") {onde.style.display = "block";} - atualizaEscalaNumerica = function(escala){ - var e = $i("i3geo_escalanum"); - if(!e){ - i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaNumerica()"); - return; - } - if(arguments.length === 1) - {e.value = escala;} - else{ - if(i3GEO.parametros.mapscale !== ""){ - e.value = parseInt(i3GEO.parametros.mapscale,10); - } - else{ - e.value = 0; - } - } - }; if(!$i("i3geo_escalanum")){ i = $inputText(id,"100","i3geo_escalanum",$trad("d10"),"9",parseInt(i3GEO.parametros.mapscale,10)); ins = "
"+i; @@ -267,13 +250,28 @@ i3GEO.gadgets = { ins += "
"; onde.innerHTML = ins; } - if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaNumerica()") < 0) - {i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaNumerica()");} + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.gadgets.atualizaEscalaNumerica()") < 0) + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.gadgets.atualizaEscalaNumerica()");} } + }, + atualizaEscalaNumerica: function(escala){ + var e = $i("i3geo_escalanum"); + if(!e){ + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.gadgets.atualizaEscalaNumerica()"); + return; + } + if(arguments.length === 1) + {e.value = escala;} else{ - atualizaEscalaNumerica = function(){}; + if(i3GEO.parametros.mapscale !== ""){ + e.value = parseInt(i3GEO.parametros.mapscale,10); + } + else{ + e.value = 0; + } } }, + /* Function: mostraEscalaGrafica diff --git a/classesjs/classe_interface.js b/classesjs/classe_interface.js index a1ac264..d5c4104 100644 --- a/classesjs/classe_interface.js +++ b/classesjs/classe_interface.js @@ -1314,9 +1314,7 @@ i3GEO.Interface = { i3GEO.parametros.mapexten = bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3]; i3GEO.parametros.mapscale = escalaAtual; i3GEO.parametros.pixelsize = i3geoOL.getResolution(); - try{ - atualizaEscalaNumerica(parseInt(escalaAtual,10)); - }catch(e){} + i3GEO.gadgets.atualizaEscalaNumerica(parseInt(escalaAtual,10)); }, zoom2ext: function(ext){ var m,b; diff --git a/interface/openlayers.htm b/interface/openlayers.htm index e4e9767..d081033 100644 --- a/interface/openlayers.htm +++ b/interface/openlayers.htm @@ -101,7 +101,7 @@ - +