Skip to content

Commit e19168f

Browse files
committed
Add size data to callback
1 parent 3817e42 commit e19168f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ResizeSensor.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
};
9595

9696
var i, j;
97-
this.call = function() {
97+
this.call = function(sizeInfo) {
9898
for (i = 0, j = q.length; i < j; i++) {
99-
q[i].call();
99+
q[i].call(this, sizeInfo);
100100
}
101101
};
102102

@@ -190,7 +190,11 @@
190190
lastHeight = newHeight;
191191

192192
if (element.resizedAttached) {
193-
element.resizedAttached.call();
193+
element.resizedAttached.call(
194+
{
195+
width: lastWidth,
196+
height: lastHeight
197+
});
194198
}
195199
};
196200

0 commit comments

Comments
 (0)