-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (34 loc) · 854 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Generated by CoffeeScript 1.3.3
(function() {
var elementCollection;
elementCollection = require("element-collection");
module.exports = function(elements) {
var x1, x2, y1, y2;
x1 = y1 = x2 = y2 = void 0;
elementCollection(elements).each(function(el) {
var elx1, elx2, ely1, ely2;
elx1 = el.offsetLeft;
ely1 = el.offsetTop;
elx2 = elx1 + el.offsetWidth;
ely2 = ely1 + el.offsetHeight;
if ((!(x1 != null)) || (elx1 < x1)) {
x1 = elx1;
}
if ((!(y1 != null)) || (ely1 < y1)) {
y1 = ely1;
}
if ((!(x2 != null)) || (elx2 > x2)) {
x2 = elx2;
}
if ((!(y2 != null)) || (ely2 > y2)) {
return y2 = ely2;
}
});
return {
left: x1,
top: y1,
width: x2 - x1,
height: y2 - y1
};
};
}).call(this);