Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-10-01 13:04:30 -0400
committerChristopher Frost2012-10-01 13:04:30 -0400
commit7e8401d5180dc7e40dc9ad5b35e68667f4199477 (patch)
tree3370a8e80af3edd61b09767b651debeb9b8eec3b
parent987b5174896277d77fcff45d5191289380004a26 (diff)
downloadorg.eclipse.virgo.kernel-7e8401d5180dc7e40dc9ad5b35e68667f4199477.tar.gz
org.eclipse.virgo.kernel-7e8401d5180dc7e40dc9ad5b35e68667f4199477.tar.xz
org.eclipse.virgo.kernel-7e8401d5180dc7e40dc9ad5b35e68667f4199477.zip
388192 stopping the page spinner killing other elements with the spinner class
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js46
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/common.js8
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/wirings.js29
3 files changed, 46 insertions, 37 deletions
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js b/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js
index e449a8f5..3dabda2a 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/bundlesGui.js
@@ -57,29 +57,31 @@ var LayoutManager = function(bundleCanvas, paper, dataSource){
};
self.displayBundle = function(bundleId){
- self.hideAll();
- self.bundleCanvas.addClass('spinner-large');
- self.focused = -1;
- var bundle;
- self.dataSource.updateBundle(bundleId, function(){
- if(self.bundles[bundleId]){
- bundle = self.bundles[bundleId];
- }else{
- bundle = new Bundle(self.paper, self.dataSource.bundles[bundleId], self.displayBundle);
- self.bundles[bundleId] = bundle;
- }
- self.focused = bundle;
- bundle.move(Math.round(self.paper.width/2), Math.round(self.paper.height/2));
- bundle.show();
- if(self.relationshipType == 'wires'){
- self.renderWires(bundle);
- }else{
- self.renderServices(bundle);
+ if(!isNaN(bundleId)){
+ self.hideAll();
+ self.bundleCanvas.addClass('spinner-large');
+ self.focused = -1;
+ var bundle;
+ self.dataSource.updateBundle(bundleId, function(){
+ if(self.bundles[bundleId]){
+ bundle = self.bundles[bundleId];
+ }else{
+ bundle = new Bundle(self.paper, self.dataSource.bundles[bundleId], self.displayBundle);
+ self.bundles[bundleId] = bundle;
+ }
+ self.focused = bundle;
+ bundle.move(Math.round(self.paper.width/2), Math.round(self.paper.height/2));
+ bundle.show();
+ if(self.relationshipType == 'wires'){
+ self.renderWires(bundle);
+ }else{
+ self.renderServices(bundle);
+ }
+ self.bundleCanvas.removeClass('spinner-large');
+ });
+ if(self.focusListener){
+ self.focusListener(bundleId);
}
- self.bundleCanvas.removeClass('spinner-large');
- });
- if(self.focusListener){
- self.focusListener(bundleId);
}
};
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/common.js b/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
index 1d6dc77f..97f834b0 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/common.js
@@ -40,8 +40,8 @@ var Util = function(){
self.start = function(){
if(!self.starting && !self.started){
self.starting = true;
- var spinnerElement = $('<div />');
- self.spinner = spinnerElement.dialog({
+ self.spinnerElement = $('<div />');
+ self.spinner = self.spinnerElement.dialog({
modal: true,
dialogClass: 'spinner-large',
closeText: '',
@@ -50,7 +50,7 @@ var Util = function(){
closeOnEscape: false,
width: '48px',
close : function(){
- spinnerElement.remove();
+ self.spinnerElement.remove();
}
});
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
@@ -74,7 +74,7 @@ var Util = function(){
self.started = true;
self.spinner.dialog('close');
self.spinner = undefined;
- $('.spinner-large').remove();
+ self.spinnerElement.remove();
}
};
diff --git a/org.eclipse.virgo.management.console/src/main/webapp/js/wirings.js b/org.eclipse.virgo.management.console/src/main/webapp/js/wirings.js
index cceafefe..3148511c 100644
--- a/org.eclipse.virgo.management.console/src/main/webapp/js/wirings.js
+++ b/org.eclipse.virgo.management.console/src/main/webapp/js/wirings.js
@@ -24,7 +24,7 @@ function pageinit() {
dataSource.updateData(function(){
layoutManager = new LayoutManager(bundleCanvas, Raphael('bundle-canvas', width, height), dataSource);
new SideBar(layoutManager, dataSource).init();
- if(util.pageLocation){
+ if(util.pageLocation && util.pageLocation.length > 0){
layoutManager.displayBundle(util.pageLocation);
}
util.pageReady();
@@ -45,18 +45,22 @@ var SideBar = function(layoutManager, dataSource){
self.layoutManager.setFocusListener(function(bundleId){
if(bundleId != self.focused){
- self.focused = bundleId;
- var rowIds = $('td:first-child', self.bundlesTable);
- $.each(rowIds, function(index, rowId){
- if($(rowId).text() == bundleId){
- rowId.scrollIntoView(true);
- $('.table-tr-selected', self.bundlesTable).removeClass('table-tr-selected');
- $(rowId).parent().addClass('table-tr-selected');
- }
- });
+ self.setFocused(bundleId);
}
});
+ self.setFocused = function(bundleId){
+ self.focused = bundleId;
+ var rowIds = $('td:first-child', self.bundlesTable);
+ $.each(rowIds, function(index, rowId){
+ if($(rowId).text() == bundleId){
+ rowId.scrollIntoView(true);
+ $('.table-tr-selected', self.bundlesTable).removeClass('table-tr-selected');
+ $(rowId).parent().addClass('table-tr-selected');
+ }
+ });
+ };
+
self.init = function(){
var tRows = new Array();
$.each(dataSource.bundles, function(id, bundle){
@@ -72,6 +76,9 @@ var SideBar = function(layoutManager, dataSource){
selectable : self.clickEvent
});
$('#side-bar').append(self.bundlesTable);
+ if(util.pageLocation && util.pageLocation.length > 0){
+ self.setFocused(util.pageLocation);
+ }
};
self.clickEvent = function(row){
@@ -156,7 +163,7 @@ var GeminiDataSource = function(){
self.bundles[bundleId].RequiredWires = response[0].value.RequiredWires;
self.bundles[bundleId].RegisteredServices = response[1].value;
self.bundles[bundleId].ServicesInUse = response[2].value;
-
+
callback();
});
};

Back to the top