1
0
postdoc/app/javascript/controllers/iframe_auto_height_controller.js
2020-12-06 21:05:11 +01:00

12 lines
246 B
JavaScript

import { Controller } from "stimulus"
export default class extends Controller {
static targets = [ "iframe" ]
connect() {
}
loaded(event) {
this.iframeTarget.height = this.iframeTarget.contentWindow.document.body.scrollHeight
}
}