[Mapbender-commits] r5825 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Mar 22 10:18:33 EDT 2010


Author: christoph
Date: 2010-03-22 10:18:33 -0400 (Mon, 22 Mar 2010)
New Revision: 5825

Modified:
   trunk/mapbender/http/javascripts/geometry.js
   trunk/mapbender/http/javascripts/mod_center1.php
   trunk/mapbender/http/javascripts/mod_coords.php
   trunk/mapbender/http/javascripts/mod_coords_div.php
Log:
use normalized jQuery event object

Modified: trunk/mapbender/http/javascripts/geometry.js
===================================================================
--- trunk/mapbender/http/javascripts/geometry.js	2010-03-22 13:19:10 UTC (rev 5824)
+++ trunk/mapbender/http/javascripts/geometry.js	2010-03-22 14:18:33 UTC (rev 5825)
@@ -2002,9 +2002,9 @@
 	this.setMouseOver = function (callback) {
 		for (var i=0; i<targets.length; i++){
 			if (typeof(canvas[i]) !== 'undefined') {
-				canvas[i].canvasDivTag.getTag().onmouseover = function (e) {
+				$(canvas[i].canvasDivTag.getTag()).mouseover(function (e) {
 					callback(e);
-				};
+				});
 			}
 		}
 	};
@@ -2012,9 +2012,9 @@
 	this.setMouseOut = function (callback) {
 		for (var i=0; i<targets.length; i++){
 			if (typeof(canvas[i]) !== 'undefined') {
-				canvas[i].canvasDivTag.getTag().onmouseout = function (e) {
+				$(canvas[i].canvasDivTag.getTag()).mouseout(function (e) {
 					callback(e);
-				};
+				});
 			}
 		}
 	};
@@ -2022,9 +2022,9 @@
 	this.setMouseClick = function (callback) {
 		for (var i=0; i<targets.length; i++){
 			if (typeof(canvas[i]) !== 'undefined') {
-				canvas[i].canvasDivTag.getTag().onclick = function (e) {
+				$(canvas[i].canvasDivTag.getTag()).click(function (e) {
 					callback(e);
-				};
+				});
 			}
 		}
 	};

Modified: trunk/mapbender/http/javascripts/mod_center1.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_center1.php	2010-03-22 13:19:10 UTC (rev 5824)
+++ trunk/mapbender/http/javascripts/mod_center1.php	2010-03-22 14:18:33 UTC (rev 5825)
@@ -45,10 +45,10 @@
 	mb_button[ind].stop = new Function ("mod_center_disable()");
 }
 function mod_center_click(){
-	mod_center_mapObj.getDomElement().onclick = mod_center_event;
+	$(mod_center_mapObj.getDomElement()).bind("click", mod_center_event);
 }
 function mod_center_disable(){
-	mod_center_mapObj.getDomElement().onclick = null;
+	$(mod_center_mapObj.getDomElement()).unbind("click", mod_center_event);
 }
 function mod_center_event(e){
 	mod_center_mapObj.getMousePos(e);

Modified: trunk/mapbender/http/javascripts/mod_coords.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_coords.php	2010-03-22 13:19:10 UTC (rev 5824)
+++ trunk/mapbender/http/javascripts/mod_coords.php	2010-03-22 14:18:33 UTC (rev 5825)
@@ -44,13 +44,15 @@
 }
 function mod_showCoords_run(){
 	var el = mod_showCoords_map.getDomElement();
-	el.onmousemove = mod_showCoords_display;
-	el.onclick = mod_showCoords_click;
+	var $el = $(el);
+	$el.bind("mousemove", mod_showCoords_display);
+	$el.bind("click", mod_showCoords_click);
 }
 function mod_showCoords_disable(){
 	var el = mod_showCoords_map.getDomElement();
-	el.onmousemove = null;
-	el.onclick = null;
+	var $el = $(el);
+	$el.unbind("mousemove", mod_showCoords_display);
+	$el.unbind("click", mod_showCoords_click);
 	window.status = "";
 }
 function mod_showCoords_click(e){

Modified: trunk/mapbender/http/javascripts/mod_coords_div.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_coords_div.php	2010-03-22 13:19:10 UTC (rev 5824)
+++ trunk/mapbender/http/javascripts/mod_coords_div.php	2010-03-22 14:18:33 UTC (rev 5825)
@@ -40,16 +40,18 @@
 	mb_button[ind].status = 0;
 	mb_button[ind].elName = mod_showCoords_div_elName;
 	mb_button[ind].fName = mod_showCoords_div_frameName;
-	mb_button[ind].go = new Function ("mod_showCoords_div_run()");
-	mb_button[ind].stop = new Function ("mod_showCoords_div_disable()");   
+	mb_button[ind].go = mod_showCoords_div_run;
+	mb_button[ind].stop = mod_showCoords_div_disable;   
 }
 function mod_showCoords_div_run(){
-	mod_showCoords_div_mapObj.getDomElement().onmousemove = mod_showCoords_div_display;
-	mod_showCoords_div_mapObj.getDomElement().onclick = mod_showCoords_div_click;
+	var $map = $(mod_showCoords_div_mapObj.getDomElement());
+	$map.bind("mousemove", mod_showCoords_div_display);
+	$map.bind("click", mod_showCoords_div_click);
 }
 function mod_showCoords_div_disable(){
-	mod_showCoords_div_mapObj.getDomElement().onclick = null;
-	mod_showCoords_div_mapObj.getDomElement().onmousemove = null;
+	var $map = $(mod_showCoords_div_mapObj.getDomElement());
+	$map.unbind("mousemove", mod_showCoords_div_display);
+	$map.unbind("click", mod_showCoords_div_click);
 	if(document.getElementById("dependentDiv")){
 		writeTag("","dependentDiv","");
 	}



More information about the Mapbender_commits mailing list