fix: scroll parent page to top on iframe load
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Controller } from '@hotwired/stimulus'
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
if ('parentIframe' in window) {
|
||||
window.iFrameResizer = {
|
||||
onReady: function () {
|
||||
window.parentIFrame.scrollTo(0, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
{% set messages = form.vars.errors|map(error => error.message) %}
|
||||
{% include '_partials/_alert.html.twig' with { 'level': 'error', 'title': 'Die Buchung konnte nicht aktualisiert werden', 'messages': messages } %}
|
||||
{% endif %}
|
||||
<div class="flex flex-col space-y-8 pb-4" {{ stimulus_controller('booking', { 'availabilities': availabilities.items }) }}>
|
||||
<div class="flex flex-col space-y-8 pb-4" {{ stimulus_controller('booking', { 'availabilities': availabilities.items }) }} {{ stimulus_controller('iframe') }}>
|
||||
<div class="p-8 border border-gray-300 rounded-md"
|
||||
{{ stimulus_controller('toggle', { 'open': true }, { 'closed': 'hidden' }) }}>
|
||||
<div role="button" class="flex items-center justify-between" {{ stimulus_action('toggle', 'toggle', 'click') }}>
|
||||
@@ -210,7 +210,7 @@
|
||||
zurück
|
||||
</a>
|
||||
<button type="submit"
|
||||
class="button bg-button bg-button--secondary" {{ stimulus_action('loading', 'toggle') }}>
|
||||
class="button bg-button bg-button--secondary" {{ stimulus_action('loading', 'toggle', null, { 'scroll': true }) }}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user