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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 4 05:28:01 EST 2008


Author: nimix
Date: 2008-03-04 05:28:01 -0500 (Tue, 04 Mar 2008)
New Revision: 2166

Modified:
   trunk/mapbender/http/javascripts/popup.js
Log:
hide iframes while moving for better performance on firefox

Modified: trunk/mapbender/http/javascripts/popup.js
===================================================================
--- trunk/mapbender/http/javascripts/popup.js	2008-03-03 16:35:47 UTC (rev 2165)
+++ trunk/mapbender/http/javascripts/popup.js	2008-03-04 10:28:01 UTC (rev 2166)
@@ -20,6 +20,7 @@
  *  title: popup title
  *  frameName: name of the popups iframe if it loads a frame
  *  opacity: opacity of the frame
+ *  moveOpacity: opacity while the user moves or resizes the frame
  *  html:content html of the frame (not parsed if url not false)
  *  url:content url of the frame
  *  minWidth: minimum width of the popup if the user resizes it
@@ -238,15 +239,13 @@
 		defaults = {
 			left:0,top:0,
 			width:300,height:250,
-			title:"",
-			frameName:"",
-			opacity:1.0,html:false,url:false,
+			title:"",frameName:"",
+			opacity:1.0,moveOpacity:0.8,html:false,url:false,
 			minWidth:false,maxWidth:false,
 			minHeight:false,maxHeight:false,
-			minTop:false,minLeft:false,
+			minTop:"document",minLeft:"document",
 			maxRight:false,maxBottom:false,
-			style:null,
-			destroy:true,
+			style:null,destroy:true,
 			closeCallback:null
 		};
 		//override defaults
@@ -275,22 +274,22 @@
 	
 		var data = {El:this,fY:settings.minTop,fX:settings.minLeft,tX:settings.maxRight,tY:settings.maxBottom,
 			fW:settings.minWidth,tW:settings.maxWidth,fH:settings.minHeight,tH:settings.maxHeight,
-			destroy:settings.destroy,opacity:settings.opacity,close:settings.closeCallback}
+			destroy:settings.destroy,opacity:settings.opacity,moveOpacity:settings.moveOpacity,close:settings.closeCallback}
 
 		//Make window Dragable
 		$(".jqDrag", this).bind('mousedown',data,function(event){
 			//set to top
 			event.data.El.css("z-index",popup_top++);
-			event.data.El.css('opacity',0.8)
+			event.data.El.css('opacity',event.data.moveOpacity)
 			//create helper div to steal mouse events
 			$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+(top.ie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
-			
+			$("iframe", event.data.El).hide();
+						
 			//Parse setiings of min and max position
 			var data = $.mbPopupFn.parseDimensions(event);
 			
 			//bind mouse events to popup
 			$().bind("mousemove",data,$.mbPopupFn.drag).bind('mouseup',event.data,$.mbPopupFn.stopdrag);
-			$("#mouse_catcher").bind("mousemove",data,$.mbPopupFn.drag).bind('mouseup',event.data,$.mbPopupFn.stopdrag);
 		});
 		
 		//Make Window resizable
@@ -300,13 +299,13 @@
 			event.data.El.css('opacity',0.8)
 			//create helper div to steal mouse events
 			$("body").append("<div style=\"position:absolute;top:0px;left:0px;width:"+$().width()+"px;height:"+$().height()+"px;z-index:"+(popup_top+2)+(top.ie?";background:url(../img/transparent.gif)":"")+"\" id=\"mouse_catcher\"></div>");
+			$("iframe", event.data.El).hide();
 
 			//Parse setiings of min and max position
 			var data = $.mbPopupFn.parseDimensions(event);
 			
 			//bind mouse events to popup
 			$().bind("mousemove",data,$.mbPopupFn.resize).bind('mouseup',event.data,$.mbPopupFn.stopresize);
-			$("#mouse_catcher").bind("mousemove",data,$.mbPopupFn.resize).bind('mouseup',event.data,$.mbPopupFn.stopresize);
 		});
 		
 		//closeButton
@@ -361,13 +360,15 @@
 		},
 		stopdrag:function(event){
 			event.data.El.css('opacity',event.data.opacity)
+			$("iframe", event.data.El).show();
 			$().unbind('mousemove',$.mbPopupFn.drag).unbind('mouseup',$.mbPopupFn.stopdrag);
-			$("#mouse_catcher").unbind('mousemove',$.mbPopupFn.drag).unbind('mouseup',$.mbPopupFn.stopdrag).remove();
+			$("#mouse_catcher").remove();
 		},
 		stopresize:function(event){
 			event.data.El.css('opacity',event.data.opacity)
+			$("iframe", event.data.El).show();
 			$().unbind('mousemove',$.mbPopupFn.resize).unbind('mouseup',$.mbPopupFn.stopresize);
-			$("#mouse_catcher").unbind('mousemove',$.mbPopupFn.resize).unbind('mouseup',$.mbPopupFn.stopresize).remove();
+			$("#mouse_catcher").remove();
 		},
 		//parse move and resize dimensions
 		parseDimensions:function(d){
@@ -385,8 +386,7 @@
 				Y:parseInt(d.data.El.css("top")),
 				W:parseInt(d.data.El.css("width")),
 				H:parseInt(d.data.El.css("height")),
-				pX:d.pageX,
-				pY:d.pageY
+				pX:d.pageX,pY:d.pageY
 			};
 		}
 	};



More information about the Mapbender_commits mailing list