File tree Expand file tree Collapse file tree
Resources/Public/JavaScript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,6 +99,13 @@ document.addEventListener('DOMContentLoaded', function () {
9999
100100 element . addEventListener ( 'mouseover' , function ( ) {
101101 let rect = element . getBoundingClientRect ( ) ;
102+ let rectInPageContext = {
103+ top : rect . top + document . documentElement . scrollTop ,
104+ left : rect . left + document . documentElement . scrollLeft ,
105+ width : rect . width ,
106+ height : rect . height
107+ } ;
108+
102109
103110 let defaultEditButtonMargin = 10 ;
104111 let defaultEditButtonHeight = 30 ;
@@ -109,7 +116,7 @@ document.addEventListener('DOMContentLoaded', function () {
109116
110117 // if the dropdown menu is too close to the bottom of the page, move it to the top
111118 // currently it's not possible to fetch the height of the dropdown menu before it's visible once, so we have to use a fixed value
112- if ( document . documentElement . clientHeight - rect . top - rect . height < 500 ) {
119+ if ( document . documentElement . scrollHeight - rectInPageContext . top - rect . height < 500 && rect . height < 700 ) {
113120 dropdownMenu . style . bottom = `19px` ;
114121 } else {
115122 dropdownMenu . style . top = `${ defaultEditButtonMargin + 30 } px` ;
You can’t perform that action at this time.
0 commit comments