Skip to content

Commit

Permalink
[BUGFIX] Use contentWindow to calculate top spacer (#736)
Browse files Browse the repository at this point in the history
Resolves: #735
  • Loading branch information
webian authored Oct 26, 2023
1 parent fe7306b commit 30411ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ define([
const firstInlineActionsToolbar = iframeDocument.querySelector('.t3-frontend-editing__inline-actions');
if (firstInlineActionsToolbar) {
firstInlineActionsToolbar.style.display = 'block'; // Tmp set display block or else the toolbar has height=0
const toolbarTopYPosition = window.pageYOffset + firstInlineActionsToolbar.getBoundingClientRect().top;
const toolbarTopYPosition = feIframe.contentWindow.scrollY + firstInlineActionsToolbar.getBoundingClientRect().top;
const toolbarHeight = firstInlineActionsToolbar.offsetHeight;
firstInlineActionsToolbar.style.display = 'none'; // Reset toolbar display to none
if (toolbarTopYPosition < toolbarHeight) {
Expand Down

0 comments on commit 30411ed

Please sign in to comment.