Skip to content

Commit

Permalink
- bug fix: was computing y offset with left (oops)
Browse files Browse the repository at this point in the history
 - no longer include toobar(s) in computation of area needed by an element
  • Loading branch information
dound committed Dec 7, 2008
1 parent b149cdb commit 9cc58a2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions jtoolbar.js
Expand Up @@ -291,15 +291,17 @@ var JTB = function() {
function computeMaxXY(e) {
var i, c, cur;
var max = new Coords(lengthToPixels(e.offsetLeft + e.offsetWidth, true),
lengthToPixels(e.offsetLeft + e.offsetHeight, false));
lengthToPixels(e.offsetTop + e.offsetHeight, false));

for(i=0; i<e.childNodes.length; i++) {
cur = computeMaxXY(e.childNodes[i]);
if(cur.x > max.x) {
max.x = cur.x;
}
if(cur.y > max.y) {
max.y = cur.y;
if(e.getAttribute('isToolbar') === null) {
cur = computeMaxXY(e.childNodes[i]);
if(cur.x > max.x) {
max.x = cur.x;
}
if(cur.y > max.y) {
max.y = cur.y;
}
}
}

Expand Down Expand Up @@ -1679,6 +1681,7 @@ var JTB = function() {
/* remove the toolbar from its current parent */
this.e_tb.parentNode.removeChild(this.e_tb);
}
this.e_tb.setAttribute('isToolbar', 'y');

var hasContent = (this.content_id !== null);
if(hasContent) {
Expand Down

0 comments on commit 9cc58a2

Please sign in to comment.