Author: Lars Michelsen <[email protected]>
Date: Tue Apr 26 21:20:11 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Tue Apr 26 21:20:11 2011 +0200
Fixed logic problem introduced in latest commits
---
share/frontend/nagvis-js/js/NagVisObject.js | 5 +++++
.../frontend/nagvis-js/js/NagVisStatefulObject.js | 8 ++++----
.../frontend/nagvis-js/js/NagVisStatelessObject.js | 8 ++++----
share/frontend/nagvis-js/js/frontend.js | 2 +-
4 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js
b/share/frontend/nagvis-js/js/NagVisObject.js
index b05ee4a..1908cb2 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -905,6 +905,11 @@ var NagVisObject = Base.extend({
obj.saveObject(this, null);
obj.remove();
+
+ // Remove object from JS
+ updateNumUnlocked(-1);
+ delete oMapObjects[objId];
+
obj = null;
objId = null;
arr = null;
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 1b01353..c8dbc92 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -268,6 +268,10 @@ var NagVisStatefulObject = NagVisObject.extend({
this.parseControls();
},
+ /**
+ * Is called to remove the rendered object
+ * This must not remove the object from the JS lists
+ */
remove: function () {
// Parsed object is the container with the id "<object_id>"
if(!this.parsedObject)
@@ -339,10 +343,6 @@ var NagVisStatefulObject = NagVisObject.extend({
// Remove object from DOM
oMap.removeChild(this.parsedObject);
-
- // Remove object from JS
- updateNumUnlocked(-1);
- delete oMapObjects[this.conf.object_id];
// Remove object reference
this.parsedObject = null;
diff --git a/share/frontend/nagvis-js/js/NagVisStatelessObject.js
b/share/frontend/nagvis-js/js/NagVisStatelessObject.js
index 004970a..cedc9ea 100644
--- a/share/frontend/nagvis-js/js/NagVisStatelessObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatelessObject.js
@@ -33,6 +33,10 @@ var NagVisStatelessObject = NagVisObject.extend({
this.base(oConf);
},
+ /**
+ * Is called to remove the rendered object
+ * This must not remove the object from the JS lists
+ */
remove: function () {
if(!this.parsedObject)
return;
@@ -59,10 +63,6 @@ var NagVisStatelessObject = NagVisObject.extend({
oMap = null;
}
- // Remove object from JS
- updateNumUnlocked(-1);
- delete oMapObjects[this.conf.object_id];
-
// Remove object reference
this.parsedObject = null;
}
diff --git a/share/frontend/nagvis-js/js/frontend.js
b/share/frontend/nagvis-js/js/frontend.js
index f00e6d8..ddcdbe5 100644
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -735,7 +735,7 @@ function updateObjects(aMapObjectInformations, sType) {
}
// Detect state changes and do some actions
- if(oMapObjects && oMapObjects[objectId].stateChanged()) {
+ if(isset(oMapObjects) && oMapObjects[objectId].stateChanged()) {
/* Internal handling */
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins