feat: optional offset for scrolling iframe to top of screen
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { Controller } from '@hotwired/stimulus'
|
||||
|
||||
export default class extends Controller {
|
||||
static values = { offsetTop: { type: Number}}
|
||||
connect() {
|
||||
if ('parentIframe' in window) {
|
||||
window.iFrameResizer = {
|
||||
onReady: function () {
|
||||
window.parentIFrame.scrollTo(0, 0)
|
||||
window.parentIFrame.scrollTo(0, this.offsetTopValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user