[Mapbender-commits] r6671 - branches/2.6/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 2 06:09:11 EDT 2010


Author: christoph
Date: 2010-08-02 10:09:11 +0000 (Mon, 02 Aug 2010)
New Revision: 6671

Modified:
   branches/2.6/http/javascripts/mod_tab.js
Log:
http://trac.osgeo.org/mapbender/ticket/665

Modified: branches/2.6/http/javascripts/mod_tab.js
===================================================================
--- branches/2.6/http/javascripts/mod_tab.js	2010-08-01 21:10:23 UTC (rev 6670)
+++ branches/2.6/http/javascripts/mod_tab.js	2010-08-02 10:09:11 UTC (rev 6671)
@@ -82,13 +82,13 @@
 		node.id = "tabs_" + that.module;
 		
 		//set css class
-		node.className = "verticalTabs";
+		node.className = "verticalTabs ui-widget-header";
 
 		//mandatory style entries
 		node.style.position = "absolute";
-		node.style.width = tabWidth;
-		node.style.height = tabHeight;
-		node.style.top = number * tabHeight;
+		node.style.width = parseInt(tabWidth, 10) + "px";
+		node.style.height = parseInt(tabHeight, 10) + "px";
+		node.style.top = parseInt(number * tabHeight, 10) + "px";
 		
 		// open or close on click
 		// see http://www.mapbender.org/index.php/Add_events_via_DOM_in_IE_and_FF
@@ -298,12 +298,12 @@
 				// animation not yet finished, move the tab down
 				else if (currentTabCurrentTop < currentTabNewTop) {
 					var pixel = Math.min(pixelPerIteration, currentTabNewTop - currentTabCurrentTop);
-					this.get(i).getNode().style.top = currentTabCurrentTop + pixel;
+					this.get(i).getNode().style.top = (currentTabCurrentTop + pixel) + "px";
 				}
 				// animation not yet finished, move the tab up
 				else if (currentTabCurrentTop > currentTabNewTop) {
 					var pixel = Math.min(pixelPerIteration, currentTabCurrentTop - currentTabNewTop);
-					this.get(i).getNode().style.top = currentTabCurrentTop - pixel;
+					this.get(i).getNode().style.top = (currentTabCurrentTop - pixel) + "px";
 				}
 				else {
 					var e = new Mb_exception("mod_tab.js: animate: unknown state for tab "+ i + " (currentTop: "+currentTabCurrentTop+", newTop:"+currentTabNewTop+")");
@@ -398,7 +398,7 @@
 		var index = getIndexById(id);
 		if (index !== null) {
 			var obj = document.getElementById(id);
-			var newpos = ((index+1) * tabHeight) + parseInt(tabTopOffset);
+			var newpos = ((index+1) * tabHeight) + parseInt(tabTopOffset, 10);
 			//try to apply for childs of horizontal tabs
 			try{
 				if(obj.tabs){
@@ -407,15 +407,16 @@
 					activeTab.top = ((newpos + 1) + obj.tab_height) + "px";
 					activeTab.left = (tabLeftOffset) + "px";
 					activeTab.width = tabWidth;
-					activeTab.height = (parseInt(that.get(index).height) - 2) - obj.tab_height;
+					activeTab.height = (parseInt(that.get(index).height, 10) - 2) - obj.tab_height;
 				}
 			}
-			catch(e){}
+			catch(e){
+			}
 			obj=obj.style;
 			obj.top = (newpos + 1) + "px";
 			obj.left = (tabLeftOffset) + "px";
-			obj.width = tabWidth;
-			obj.height = (parseInt(that.get(index).height, 10) - 2);
+			obj.width = tabWidth + "px";
+			obj.height = (parseInt(that.get(index).height, 10) - 2) + "px";
 			obj.visibility = 'visible';
 			obj.display = 'block';
 		}
@@ -433,7 +434,7 @@
 		}
 		tabInterval = setInterval(function(){
 			tabs.animate(openOrClose);
-		},1);
+		}, 10);
 	};
 	
 	/**



More information about the Mapbender_commits mailing list