Author:   Lars Michelsen <[email protected]>
Date:     Sun Sep 25 11:41:48 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sun Sep 25 11:41:48 2011 +0200

Fixed textbox/line adding with opened sidebar; Generally fixed textbox adding 
with new add/modify dialog

---

 share/frontend/nagvis-js/js/edit.js |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/share/frontend/nagvis-js/js/edit.js 
b/share/frontend/nagvis-js/js/edit.js
index d9f2041..8d8064e 100644
--- a/share/frontend/nagvis-js/js/edit.js
+++ b/share/frontend/nagvis-js/js/edit.js
@@ -443,13 +443,18 @@ function addClick(e) {
     if(document.body)
         document.body.style.cursor = 'default';
 
+    if(addObjType == 'textbox') {
+        var w = addX.pop();
+        var h = addY.pop();
+    }
+
     var sUrl = '';
     if(addAction == 'add' || addAction == 'clone')
         sUrl = oGeneralProperties.path_server + '?mod=Map&act=addModify'
                + '&show=' + oPageProperties.map_name
                + '&type=' + addObjType
                + '&x=' + addX.join(',')
-               + '&y=' + addY.join(',')
+               + '&y=' + addY.join(',');
 
     if(addViewType != 'icon')
         sUrl += '&view_type=' + addViewType;
@@ -457,6 +462,9 @@ function addClick(e) {
     if(addAction == 'clone' && objid !== -1)
         sUrl += '&clone_id='+objid;
 
+    if(addObjType == 'textbox')
+        sUrl += '&w=' + (w - addX[0]) + '&h=' + (h - addY[0]);
+
     if(sUrl === '')
         return false;
 
@@ -487,9 +495,9 @@ function addFollowing(e) {
     addShape.clear();
 
     if(addViewType === 'line')
-    addShape.drawLine(addX[0], addY[0], pos[0], pos[1]);
+        addShape.drawLine(addX[0], addY[0], pos[0] - getSidebarWidth(), 
pos[1]);
     else
-    addShape.drawRect(addX[0], addY[0], (pos[0] - addX[0]), (pos[1] - 
addY[0]));
+        addShape.drawRect(addX[0], addY[0], (pos[0] - getSidebarWidth() - 
addX[0]), (pos[1] - addY[0]));
 
     addShape.paint();
 }


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to