Author: Lars Michelsen <[email protected]>
Date: Sat Jul 23 12:01:38 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Sat Jul 23 12:01:38 2011 +0200
Bugfixes for IE and two part lines
* Bugfix: Fixed coloring of two part lines in IE
* Bugfix: Fixed drawing of second part in two part lines in IE
---
ChangeLog | 2 +
.../frontend/nagvis-js/js/NagVisStatefulObject.js | 8 +++---
share/frontend/nagvis-js/js/lines.js | 29 +++++++++++++-------
3 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a7a56d8..4b94d86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
Frontend
* Bugfix: Fixed background image positioning with enabled sidebar and small
screens
+ * Bugfix: Fixed coloring of two part lines in IE
+ * Bugfix: Fixed drawing of second part in two part lines in IE
Core
* omd_install: Installing missing doc/ dir now; Cleaning cache files on
install
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 88f4d5f..975bff7 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -545,8 +545,8 @@ var NagVisStatefulObject = NagVisObject.extend({
var width = this.conf.line_width;
- var colorFill = '';
- var colorFill2 = '';
+ var colorFill = '';
+ var colorFill2 = '';
var colorBorder = '#000000';
var setPerfdata = [];
@@ -575,7 +575,7 @@ var NagVisStatefulObject = NagVisObject.extend({
// Adjust fill color based on perfdata for weathermap lines
if(this.conf.line_type == 13 || this.conf.line_type == 14) {
- colorFill = '#000000';
+ colorFill = '#000000';
colorFill2 = '#000000';
// Convert perfdata to structured array
@@ -643,7 +643,7 @@ var NagVisStatefulObject = NagVisObject.extend({
if(setPerfdata[1][2] !== null && setPerfdata[1][2] == '%' &&
setPerfdata [1][1] !== null && setPerfdata[1][1] >= 0 && setPerfdata[1][1] <=
100)
colorFill2 = this.getColorFill(setPerfdata[1][1]);
else {
- colorFill = '#000000';
+ colorFill2 = '#000000';
this.perfdataError('Second', setPerfdata[1][1],
this.conf.name, this.conf.service_description);
}
}
diff --git a/share/frontend/nagvis-js/js/lines.js
b/share/frontend/nagvis-js/js/lines.js
index 0c35096..0e39ae7 100644
--- a/share/frontend/nagvis-js/js/lines.js
+++ b/share/frontend/nagvis-js/js/lines.js
@@ -106,27 +106,36 @@ function drawPolygonBasedObject(objectId, num, xCoord,
yCoord, z, colorFill, col
if(!isset(oCanvas.parentNode)) {
var oLineContainer = document.getElementById(objectId+'-line');
- if(oLineContainer)
- oLineContainer.appendChild(oCanvas);
- oLineContainer = null;
+ if(oLineContainer) {
+ oLineContainer.appendChild(oCanvas);
+ oLineContainer = null;
+ }
}
oCanvas = null;
} else {
var oLine = document.getElementById(objectId+'-line');
// When redrawing while e.g. moving remove old parts first
- if(oLine.hasChildNodes())
- while(oLine.childNodes.length >= 1)
- oLine.removeChild(oLine.firstChild);
-
+ // But only remove the elements of the current line part
+ var oContainer;
+ if(oLine.hasChildNodes() && oLine.childNodes.length > num - 1) {
+ oContainer = oLine.childNodes[num - 1];
+ while(oContainer.hasChildNodes() && oContainer.childNodes.length
>= 1)
+ oContainer.removeChild(oContainer.firstChild);
+ } else {
+ oContainer = document.createElement('div');
+ oLine.appendChild(oContainer);
+ }
+
// Fallback to old line style
- var oL = new jsGraphics(oLine);
+ var oL = new jsGraphics(oContainer);
oL.setColor(colorFill);
oL.fillPolygon(xCoord, yCoord);
oL.paint();
- oL = null;
- oLine = null;
+ oL = null;
+ oContainer = null;
+ oLine = null;
}
oCanvas = null;
------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide. Store less, Store more with what you own, Move data to
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins