Skip to content

Commit 9555c7d

Browse files
committed
Update to latest consolidated repo
1 parent 0b71531 commit 9555c7d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

basic-stack.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
contribute: {
4848

4949
contentChanged: function() {
50+
this._listenForLoadEvents('img');
51+
this._listenForLoadEvents('iframe');
5052
setTimeout(function() {
5153
this.recalc();
5254
}.bind(this));
@@ -105,6 +107,19 @@
105107
this.$.stackContainer.style.width = '100%';
106108
this.recalc();
107109
}
110+
},
111+
112+
// Listen for load events on children of the specified tag type.
113+
// TODO: Share this with basic-framed-content.
114+
_listenForLoadEvents: function(tag) {
115+
var childNodes = Basic.ContentHelpers.flattenChildNodes(this);
116+
Array.prototype.forEach.call(childNodes, function(child) {
117+
if (child.localName === tag) {
118+
child.addEventListener('load', function() {
119+
this.recalc();
120+
}.bind(this));
121+
}
122+
}.bind(this));
108123
}
109124

110125
});

0 commit comments

Comments
 (0)