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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Dec 2 11:07:31 EST 2010


Author: christoph
Date: 2010-12-02 08:07:31 -0800 (Thu, 02 Dec 2010)
New Revision: 7184

Modified:
   trunk/mapbender/http/javascripts/mod_tab_expandable.js
Log:
#730

Modified: trunk/mapbender/http/javascripts/mod_tab_expandable.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_tab_expandable.js	2010-12-02 16:04:32 UTC (rev 7183)
+++ trunk/mapbender/http/javascripts/mod_tab_expandable.js	2010-12-02 16:07:31 UTC (rev 7184)
@@ -34,7 +34,8 @@
 }
 
 function tab_init(){
-    var obj = document.getElementById("tabs").style;
+	var tabNode = document.getElementById("tabs");
+	var obj = tabNode.style;
     
     // generate a new tab array
     tabs = new VerticalTabArray(tab_style);
@@ -47,6 +48,12 @@
     if (open_tab !== "") {
         tabs.openTab(tabs.get(open_tab).module);
     }
+	$(tabNode).children("div").hover(function () {
+		$(this).addClass("ui-state-hover");
+	}, function () {
+		$(this).removeClass("ui-state-hover");
+	});
+
 }
 
 function tab_open(elementName){
@@ -85,7 +92,7 @@
         node.id = "tabs_" + that.module;
         
         //set css class
-        node.className = "verticalTabs ui-widget-header";
+        node.className = "verticalTabs ui-state-default";
         
         //mandatory style entries
         node.style.position = "absolute";
@@ -95,20 +102,10 @@
         
         this.originalHeight = tabHeight;
         
-        // open or close on click
-        // see http://www.mapbender.org/index.php/Add_events_via_DOM_in_IE_and_FF
-        if ($.browser.msie) {
+		$(node).click(function() {
+			tabs.toggleTab(that.module);
+		});
         
-            node.onclick = function(){
-                tabs.toggleTab(that.module);
-            };
-        }
-        else {
-            node.onclick = function(){
-                tabs.toggleTab(that.module);
-            };
-        }
-        
         // tab header
         node.innerHTML = title;
     };
@@ -215,7 +212,9 @@
      * @param {String} id the ID of the GUI element within the tab.
      */
     this.toggleTab = function(id){
-        // if no tab is currently opening or closing
+		$("#tabs_" + id).addClass("ui-state-active").siblings().removeClass("ui-state-active");
+
+		// if no tab is currently opening or closing
         if (isAnimationFinished()) {
             for (var i = 0; i < this.count(); i++) {
                 hideFrame(this.get(i).module);
@@ -386,6 +385,7 @@
                 }
             }
             activeTabId = id;
+			$("#tabs_" + id).addClass("ui-state-active").siblings().removeClass("ui-state-active");
             startAnimation("open");
         }
     };



More information about the Mapbender_commits mailing list