[Mapbender-commits] r7533 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Feb 4 11:03:06 EST 2011


Author: kmq
Date: 2011-02-04 08:03:06 -0800 (Fri, 04 Feb 2011)
New Revision: 7533

Modified:
   trunk/mapbender/lib/mb.ui.displayFeatures.js
Log:
Georss popups use back/forward buttons instead of tabs (still relies on jquiery tabs)

Modified: trunk/mapbender/lib/mb.ui.displayFeatures.js
===================================================================
--- trunk/mapbender/lib/mb.ui.displayFeatures.js	2011-02-04 12:46:46 UTC (rev 7532)
+++ trunk/mapbender/lib/mb.ui.displayFeatures.js	2011-02-04 16:03:06 UTC (rev 7533)
@@ -123,17 +123,53 @@
 						description = g.e.getElementValueByName("description");
 						$tabs.append('<li><a href="#rsspopup_'+ i +'">'+ title + '</a></li>');
 						self._popup.append('<div id="rsspopup_'+ i +'"><h1>'+ title +'</h1><p>'+ description +'</p></h1>');
+					
 						if($tabs.children().size() > 1){
-							var $tabcontainer = $("<div><div>");
-							$tabcontainer.append($tabs);
-							$tabcontainer.append($('div',self._popup));	
-							self._popup.append($tabcontainer);
-							$tabcontainer.tabs();
 						}
 						self._popup.dialog('open');
 					}
+			
+
+					if($tabs.children().size() > 1){	
+						var $tabcontainer = $("<div><div>");
+						$tabcontainer.append($tabs);
+						$tabcontainer.append($('div',self._popup));	
+						$tabs.css("display","none");
+						self._popup.append($tabcontainer);
+						$tabcontainer.tabs();
+						// -1 because we need it zero based later
+						var tabcount = $tabcontainer.find(".ui-tabs-panel").size() -1;
+						$tabcontainer.find(".ui-tabs-panel").each(function(i){
+
+							var  $navbar = $("<div></div>");
+							$(this).append($navbar);
+							// add to first panel
+							if(i == 0 ){
+								var next = i+1;
+								$navbar.append('<a style="float:right;" href="#" class="next-tab" rel="'+next+'">mehr</a>');
+							}
+							// add to all except the first panel
+							if(i > 0 ){
+								var prev = i-1;
+								$navbar.append('<a href="#" class="prev-tab" rel="'+prev+'">zurück</a>');
+							}
+							// add to all except first and last panel
+							if( tabcount  > i && i > 0  ){
+								var next = i+1;
+								$navbar.append('<a style="float:right;" href="#" class="next-tab" rel="'+next+'">vor</a>');
+							}
+						});
+						$tabcontainer.find(".next-tab, .prev-tab").click(function(){
+							$tabcontainer.tabs("select",$(this).attr("rel"));
+							return false;
+						});
+
+
+					}
 				
 
+	
+
 				};})(feed.geomArray, pointGeometries)
 				});
 				req.send();



More information about the Mapbender_commits mailing list