Author: Lars Michelsen <[email protected]>
Date: Sun Nov 24 16:12:09 2013 +0100
Committer: Lars Michelsen <[email protected]>
Commit-Date: Sun Nov 24 16:12:09 2013 +0100
Fine tuning zoom=fill (shapes and header are taken into account)
---
share/frontend/nagvis-js/js/NagVisObject.js | 32 ++++++++++++++++++++
.../frontend/nagvis-js/js/NagVisStatefulObject.js | 32 --------------------
share/frontend/nagvis-js/js/frontend.js | 2 +-
3 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js
b/share/frontend/nagvis-js/js/NagVisObject.js
index aa766fb..1e43cbd 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -608,6 +608,38 @@ var NagVisObject = Base.extend({
return false;
},
+ getObjLeft: function () {
+ if (this.conf.x.toString().split(',').length > 1) {
+ return Math.min.apply(Math, this.parseCoords(this.conf.x, 'x'));
+ } else {
+ return this.parseCoord(this.conf.x, 'x');
+ }
+ },
+
+ getObjTop: function () {
+ if (this.conf.x.toString().split(',').length > 1) {
+ return Math.min.apply(Math, this.parseCoords(this.conf.y, 'y'));
+ } else {
+ return this.parseCoord(this.conf.y, 'y');
+ }
+ },
+
+ getObjWidth: function () {
+ var o = document.getElementById(this.conf.object_id + '-icondiv');
+ if(o && o.clientWidth)
+ return parseInt(o.clientWidth);
+ else
+ return 0;
+ },
+
+ getObjHeight: function () {
+ var o = document.getElementById(this.conf.object_id + '-icondiv');
+ if(o && o.clientHeight)
+ return parseInt(o.clientHeight);
+ else
+ return 0;
+ },
+
/**
* This method parses a given coordinate which can be a simple integer
* which is simply returned or a reference to another object and/or
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 4aa5489..6735b87 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -986,38 +986,6 @@ var NagVisStatefulObject = NagVisObject.extend({
this.unlockLabel();
},
- getObjWidth: function () {
- var o = document.getElementById(this.conf.object_id + '-icondiv');
- if(o && o.clientWidth)
- return parseInt(o.clientWidth);
- else
- return 0;
- },
-
- getObjHeight: function () {
- var o = document.getElementById(this.conf.object_id + '-icondiv');
- if(o && o.clientHeight)
- return parseInt(o.clientHeight);
- else
- return 0;
- },
-
- getObjLeft: function () {
- if (this.conf.x.toString().split(',').length > 1) {
- return Math.min.apply(Math, this.parseCoords(this.conf.x, 'x'));
- } else {
- return this.parseCoord(this.conf.x, 'x');
- }
- },
-
- getObjTop: function () {
- if (this.conf.x.toString().split(',').length > 1) {
- return Math.min.apply(Math, this.parseCoords(this.conf.y, 'y'));
- } else {
- return this.parseCoord(this.conf.y, 'y');
- }
- },
-
parseIconControls: function () {
// Simply make it dragable. Maybe will be extended in the future...
makeDragable([this.conf.object_id+'-icondiv'], this.saveObject,
this.moveObject);
diff --git a/share/frontend/nagvis-js/js/frontend.js
b/share/frontend/nagvis-js/js/frontend.js
index 43e37e2..a9663bb 100644
--- a/share/frontend/nagvis-js/js/frontend.js
+++ b/share/frontend/nagvis-js/js/frontend.js
@@ -1501,7 +1501,7 @@ function set_fill_zoom_factor() {
}
var border = 40; // border per side in px * 2
- var zoom_y = parseInt((pageHeight() - border) / parseFloat(c_bottom) *
100);
+ var zoom_y = parseInt((pageHeight() - border - getHeaderHeight()) /
parseFloat(c_bottom) * 100);
var zoom_x = parseInt((pageWidth() - border)/ parseFloat(c_right) * 100);
set_zoom(Math.min(zoom_y, zoom_x));
}
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins