Skip to content

Commit

Permalink
fixes #807
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcobain committed Sep 6, 2017
1 parent a64aad5 commit 68f4832
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions addon/components/paper-dialog-inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,24 @@ export default Component.extend(Translate3dMixin, {
}
},

imagesLoaded() {
let content = this.element.querySelector('md-dialog-content');
this.set('contentOverflow', content.scrollHeight > content.clientHeight);
},

didInsertElement() {
this._super(...arguments);
this.checkContentOverflow();
// content overflow might change depending on load of images inside dialog.
let images = this.$().find('img');
images.on(`load.${this.elementId}`, run.bind(this, this.imagesLoaded));
images.on(`load.${this.elementId}`, run.bind(this, this.checkContentOverflow));
},

willDestroyElement() {
this._super(...arguments);
let images = this.$().find('img');
images.off(`load.${this.elementId}`);
},

checkContentOverflow() {
let content = this.element.querySelector('md-dialog-content');
if (content) {
this.set('contentOverflow', content.scrollHeight > content.clientHeight);
}
}
});

0 comments on commit 68f4832

Please sign in to comment.