Build distribution

This commit is contained in:
kangax 2013-05-19 16:26:23 +02:00
parent 21bfba0d42
commit d2bcfc922d
4 changed files with 25 additions and 15 deletions

26
dist/all.js vendored
View file

@ -3364,15 +3364,25 @@ fabric.util.string = {
* @return {Object} Object with "left" and "top" properties
*/
function getElementOffset(element) {
// TODO (kangax): need to fix this method
var valueT = 0, valueL = 0;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;
element = element.offsetParent;
var docElem, win,
box = {left: 0, top: 0},
doc = element && element.ownerDocument;
if (!doc){
return {left: 0, top: 0};
}
while (element);
return ({ left: valueL, top: valueT });
docElem = doc.documentElement;
if ( typeof element.getBoundingClientRect !== "undefined" ) {
box = element.getBoundingClientRect();
}
if(doc != null && doc === doc.window){
win = doc;
} else {
win = doc.nodeType === 9 && doc.defaultView;
}
return {
left: box.left + win.pageXOffset - (docElem.clientLeft || 0),
top: box.top + win.pageYOffset - (docElem.clientTop || 0)
};
}
/**

10
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -104,13 +104,13 @@
box = {left: 0, top: 0},
doc = element && element.ownerDocument;
if (!doc){
return {left: 0, top: 0}
return {left: 0, top: 0};
}
docElem = doc.documentElement;
if ( typeof element.getBoundingClientRect !== "undefined" ) {
box = element.getBoundingClientRect();
}
if(doc != null && doc == doc.window){
if(doc != null && doc === doc.window){
win = doc;
} else {
win = doc.nodeType === 9 && doc.defaultView;