11 lines
377 B
JavaScript
11 lines
377 B
JavaScript
import { Controller } from "stimulus"
|
|
|
|
export default class extends Controller {
|
|
onLoad(evt) {
|
|
const iframe = evt.currentTarget;
|
|
iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
|
|
|
|
const links = iframe.contentWindow.document.querySelectorAll('a');
|
|
Array.from(links).forEach(link => link.target = '_blank');
|
|
}
|
|
} |