svn commit: r155 - trunk/mapbender/http/javascripts/map.php

christoph at osgeo.org christoph at osgeo.org
Thu Apr 27 08:51:47 EDT 2006


Author: christoph
Date: 2006-04-27 12:51:47+0000
New Revision: 155

Modified:
   trunk/mapbender/http/javascripts/map.php

Log:
button handling improved for buttons in iframes

Modified: trunk/mapbender/http/javascripts/map.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/map.php?view=diff&rev=155&p1=trunk/mapbender/http/javascripts/map.php&p2=trunk/mapbender/http/javascripts/map.php&r1=154&r2=155
==============================================================================
--- trunk/mapbender/http/javascripts/map.php	(original)
+++ trunk/mapbender/http/javascripts/map.php	2006-04-27 12:51:47+0000
@@ -882,30 +882,27 @@
 /****************BUTTON HANDLING*************************/
 var mb_button = new Array();
 
-function mb_regButton_frame(wii, obj, frameName){
-   var ind = mb_button.length;
-   mb_button[ind] = new mb_conButton(wii, ind);
-   eval("window.frames['" + frameName + "']."+wii+"(obj,"+ind+")");
-   mb_button[ind].prev = mb_button[ind].src;
-   mb_button[ind].src = mb_button[ind].img_over;
-   mb_button[ind].onmouseover = new Function("mb_button_over("+ind+")");
-   mb_button[ind].onmouseout = new Function("mb_button_out("+ind+")");
-   mb_button[ind].onclick = new Function("mb_button_click("+ind+")");
-   mb_button[ind].frameName = frameName;
+function mb_regButton_frame(wii, frameName){
+	var ind = mb_button.length;
+	mb_button[ind] = new mb_conButton(wii, ind);
+	if (frameName=="") {
+		eval(wii+"("+ind+")");
+	}
+	else {
+		eval("window.frames['" + frameName + "']."+wii+"("+ind+")");
+	}
+	mb_button[ind].prev = mb_button[ind].src;
+	mb_button[ind].src = mb_button[ind].img_over;
+	mb_button[ind].onmouseover = new Function("mb_button_over("+ind+")");
+	mb_button[ind].onmouseout = new Function("mb_button_out("+ind+")");
+	mb_button[ind].onclick = new Function("mb_button_click("+ind+")");
+	mb_button[ind].frameName = frameName;
 }
 
 function mb_regButton(wii){
-   var ind = mb_button.length;
-   mb_button[ind] = new mb_conButton(wii, ind);
-   eval(wii+"("+ind+")");
-   mb_button[ind].prev = mb_button[ind].src;
-   mb_button[ind].src = mb_button[ind].img_over;
-   mb_button[ind].onmouseover = new Function("mb_button_over("+ind+")");
-   mb_button[ind].onmouseout = new Function("mb_button_out("+ind+")");
-   mb_button[ind].onclick = new Function("mb_button_click("+ind+")");
-   mb_button[ind].frameName = "";
-   
+	mb_regButton_frame(wii, "");
 }
+
 function mb_conButton(wii, ind){
    this.wii = wii;
    return true;




More information about the Mapbender_commits mailing list