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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 13 09:57:50 EST 2010


Author: verenadiewald
Date: 2010-01-13 09:57:48 -0500 (Wed, 13 Jan 2010)
New Revision: 5320

Modified:
   trunk/mapbender/http/javascripts/mod_ResultList.js
Log:
only open detail popup if detail columns are defined

Modified: trunk/mapbender/http/javascripts/mod_ResultList.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_ResultList.js	2010-01-13 13:03:44 UTC (rev 5319)
+++ trunk/mapbender/http/javascripts/mod_ResultList.js	2010-01-13 14:57:48 UTC (rev 5320)
@@ -188,41 +188,43 @@
 				var modelIndex = $(row).data("modelindex");
 				var feature = me.model.getFeature(modelIndex);
 
-				var infoPopupHtml = "<table>";
-				for (var columnIndex in me.detailColumns) {
-					infoPopupHtml += "<tr>";
-					infoPopupHtml += "<td>" + me.detailColumns[columnIndex].label + "</td>";
-					infoPopupHtml += "<td>" + me.model.getFeatureProperty(modelIndex, me.detailColumns[columnIndex].name)+ "</td>";
-					infoPopupHtml += "</tr>";
-				}
-				infoPopupHtml += "</table>";
-				
-				var infoPopup = $('<div class="infoPopup"></div>');
-				infoPopup.append(infoPopupHtml);
-				
-				buttonList = $("<ul></ul>").css("list-style-type","none");
-				for (var c in popupButtons){
-					var callback = function() {
-						var  args =  { 
-							WFSConf: me.WFSConf,
-							geoJSON: feature,
-							selectedRows: me.getSelected()
+				if(me.detailColumns.length > 0) {
+					var infoPopupHtml = "<table>";
+					for (var columnIndex in me.detailColumns) {
+						infoPopupHtml += "<tr>";
+						infoPopupHtml += "<td>" + me.detailColumns[columnIndex].label + "</td>";
+						infoPopupHtml += "<td>" + me.model.getFeatureProperty(modelIndex, me.detailColumns[columnIndex].name)+ "</td>";
+						infoPopupHtml += "</tr>";
+					}
+					infoPopupHtml += "</table>";
+					
+					var infoPopup = $('<div class="infoPopup"></div>');
+					infoPopup.append(infoPopupHtml);
+					
+					buttonList = $("<ul></ul>").css("list-style-type","none");
+					for (var c in popupButtons){
+						var callback = function() {
+							var  args =  { 
+								WFSConf: me.WFSConf,
+								geoJSON: feature,
+								selectedRows: me.getSelected()
+							};
+							popupButtons[c].callback.call(this,args);
 						};
-						popupButtons[c].callback.call(this,args);
-					};
-					var button = $("<li><button type='button' class='ui-state-default ui-corner-all'>"+popupButtons[c].title+"</button></li>").click(callback);
-					button.css("display","inline");
-					buttonList.append(button);
+						var button = $("<li><button type='button' class='ui-state-default ui-corner-all'>"+popupButtons[c].title+"</button></li>").click(callback);
+						button.css("display","inline");
+						buttonList.append(button);
+					}
+					infoPopup.append(buttonList);
+					infoPopup.dialog({
+						title : "Details", 
+						autoOpen : false, 
+						draggable : true,
+						width : options.infoPopupWidth,
+						height : options.infoPopupHeight
+					});
+					infoPopup.dialog("open");
 				}
-				infoPopup.append(buttonList);
-				infoPopup.dialog({
-					title : "Details", 
-					autoOpen : false, 
-					draggable : true,
-					width : options.infoPopupWidth,
-					height : options.infoPopupHeight
-				});
-				infoPopup.dialog("open");
 				
 				if (options.maxHighlightedPoints > 0 && feature.getTotalPointCount() > options.maxHighlightedPoints) {
 					feature = feature.getBBox4();



More information about the Mapbender_commits mailing list