FELIX-1930 : Clicking action on bundles detail page shows full bundle list while URL stays on bundles/<id>

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@889539 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/res/ui/bundles.js b/webconsole/src/main/resources/res/ui/bundles.js
index 028d8b4..588a9ec 100644
--- a/webconsole/src/main/resources/res/ui/bundles.js
+++ b/webconsole/src/main/resources/res/ui/bundles.js
@@ -40,11 +40,17 @@
 	$(".statusline").empty().append(eventData.status);
 	$("#plugin_table > tbody > tr").remove();
     for ( var idx in eventData.data ) {
-        entry( eventData.data[idx] );
+    	if ( currentBundle == null || !drawDetails || currentBundle == eventData.data[idx].id) {
+            entry( eventData.data[idx] );
+    	}
     }
     $("#plugin_table").trigger("update");
-    if ( drawDetails ) {
-	    renderDetails(eventData);
+    if ( drawDetails && eventData.data.length == 1 ) {
+	    renderDetails(eventData.data[0]);    
+    } else if ( currentBundle != null ) {
+    	var id = currentBundle;
+    	hideDetails(id);
+    	showDetails(id);
     }
 }
 
@@ -139,12 +145,14 @@
 }
 
 function showDetails( id ) {
+	currentBundle = id;
     $.get(pluginRoot + "/" + id + ".json", null, function(data) {
-    	renderDetails(data);
+    	renderDetails(data.data[0]);
     }, "json");
 }
 
 function hideDetails( id ) {
+	currentBundle = null;
 	$("#img" + id).each(function() {
 		$("#pluginInlineDetails").remove();
 		$(this).attr("src", appRoot + "/res/imgs/arrow_right.png");
@@ -155,7 +163,6 @@
 }
 
 function renderDetails( data ) {
-	data = data.data[0];
 	$("#pluginInlineDetails").remove();
 	$("#entry" + data.id + " > td").eq(1).append("<div id='pluginInlineDetails'/>");
 	$("#img" + data.id).each(function() {