Skip to content

Commit

Permalink
fix: scroll clicked element into view after ajax when interacting wit…
Browse files Browse the repository at this point in the history
…h tree view
  • Loading branch information
Simon Sendler committed Aug 30, 2024
1 parent 0799b3a commit fbdb1ea
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,12 @@
<f:ajax
execute="ead-details"
render="ead-details"
onevent="(data) => {gwHandleTooltip.init(data); gwInitTooltips.init();}" />
onevent="(data) => {
gwHandleTooltip.init(data);
gwInitTooltips.init();
if (data.status === 'success') {
document.getElementById(data.source.id).scrollIntoView({block: 'start', inline: 'nearest'});
}}" />
</h:commandLink>
</div>
<div class="content">
Expand Down Expand Up @@ -404,7 +409,13 @@
<f:ajax
execute="ead-details"
render="hierarchy ead-details globalMessage"
onevent="(data) => {gwHandleTooltip.init(data); gwInitTooltips.init();}" />
onevent="(data) => {
gwHandleTooltip.init(data);
gwInitTooltips.init();
if (data.status === 'success') {
document.getElementById(data.source.id).scrollIntoView({block: 'start', inline: 'nearest'});
}
}" />
</h:commandLink>
</div>
</div>
Expand Down

0 comments on commit fbdb1ea

Please sign in to comment.