Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2012-10-30 13:03:17 -0400
committerChristopher Frost2012-10-30 13:03:17 -0400
commitef9aa9bbacd622b8844cc8a95d7a7912e0400329 (patch)
tree900d4ea34057c38896d2fd048bdce46dfa5760dd
parent5bc75b15adcafc19e403cc6fa0b43b1644864fe9 (diff)
downloadorg.eclipse.virgo.kernel-ef9aa9bbacd622b8844cc8a95d7a7912e0400329.tar.gz
org.eclipse.virgo.kernel-ef9aa9bbacd622b8844cc8a95d7a7912e0400329.tar.xz
org.eclipse.virgo.kernel-ef9aa9bbacd622b8844cc8a95d7a7912e0400329.zip
392460 Fix the z ordering of infoboxes
-rw-r--r--org.eclipse.virgo.management.console/src/main/webapp/js/common.js30
1 files changed, 13 insertions, 17 deletions
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 58e82dd9..b8298f7d 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
@@ -406,12 +406,7 @@ var InfoBox = function(properties){
var floorCount = Math.floor(infoBoxCount/10);
var xOffSet = floorCount * 250;
infoBoxCount = infoBoxCount - (floorCount * 10);
- var zIndex = 0;
- $.each($('.info-box'), function(index, otherInfoBox){
- if($(otherInfoBox).css('z-index') >= zIndex){
- zIndex = $(otherInfoBox).css('z-index') + 1;
- }
- });
+ var zIndex = self.getHighestZIndex() + 1;
self.dialogBox.css({position: 'absolute',
left: position.left + 40 + xOffSet + (infoBoxCount*25),
top: position.top + 50 + (infoBoxCount*25),
@@ -420,20 +415,21 @@ var InfoBox = function(properties){
$('body').append(self.dialogBox);
self.isVisible = true;
}else{
- var zIndex = self.dialogBox.css('z-index');
- var needToMove = false;
- $.each($('.info-box'), function(index, otherInfoBox){
- if($(otherInfoBox).css('z-index') >= zIndex){
- zIndex = $(otherInfoBox).css('z-index') + 1;
- needToMove = true;
- }
- });
- if(needToMove){
- self.dialogBox.css({'z-index': zIndex});
- }
+ self.dialogBox.css({'z-index': self.getHighestZIndex() + 1});
}
};
+ self.getHighestZIndex = function(){
+ var zIndex = 0;
+ $.each($('.info-box'), function(index, otherInfoBox){
+ var checkZIndex = new Number($(otherInfoBox).css('z-index')).valueOf();
+ if(checkZIndex > zIndex){
+ zIndex = checkZIndex;
+ }
+ });
+ return zIndex;
+ };
+
self.hide = function(){
if(self.isVisible){
self.dialogBox.detach();

Back to the top