+ Cleaned up TabItem bounds getting and setting (the translation between our coordinates and the div style needs to be done carefully, in particular due to the padding in the tab style), and added a unit test for it

This commit is contained in:
Ian Gilman 2010-06-15 15:55:47 -07:00
parent f5531e7c7b
commit 555ae49cad
2 changed files with 2 additions and 18 deletions

View File

@ -444,14 +444,8 @@ iQ.fn = iQ.prototype = {
// Function: bounds
bounds: function(unused) {
Utils.assert('does not yet support setting', unused === undefined);
Utils.assert('does not yet support multi-objects (or null objects)', this.length == 1);
var el = this[0];
return new Rect(
parseInt(el.style.left) || el.offsetLeft,
parseInt(el.style.top) || el.offsetTop,
el.clientWidth,
el.clientHeight
);
var p = this.position();
return new Rect(p.left, p.top, this.width(), this.height());
},
// ----------

View File

@ -544,16 +544,6 @@ var Utils = {
return date.getTime();
},
// ___ Geometry
getBounds: function(el) {
return new Rect(
parseInt(el.style.left) || el.offsetLeft,
parseInt(el.style.top) || el.offsetTop,
el.clientWidth,
el.clientHeight
);
},
// ___ Misc
isDOMElement: function(object) {
return (object && typeof(object.nodeType) != 'undefined' ? true : false);