1
0
postdoc/app/javascript/controllers/iframe_auto_height_controller.js

12 lines
246 B
JavaScript
Raw Normal View History

2020-12-06 20:49:03 +01:00
import { Controller } from "stimulus"
export default class extends Controller {
static targets = [ "iframe" ]
connect() {
}
loaded(event) {
this.iframeTarget.height = this.iframeTarget.contentWindow.document.body.scrollHeight
}
}