X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a0fe6147d8a658c21271c54110aec2251f4ed08a..refs/pull/3745/head:/resources/js/components/dropdown.js diff --git a/resources/js/components/dropdown.js b/resources/js/components/dropdown.js index e84076502..781f90860 100644 --- a/resources/js/components/dropdown.js +++ b/resources/js/components/dropdown.js @@ -37,12 +37,8 @@ class DropDown { if (this.moveMenu) { this.body.appendChild(this.menu); this.menu.style.position = 'fixed'; - if (this.direction === 'right') { - this.menu.style.right = `${(menuOriginalRect.right - menuOriginalRect.width)}px`; - } else { - this.menu.style.left = `${menuOriginalRect.left}px`; - } this.menu.style.width = `${menuOriginalRect.width}px`; + this.menu.style.left = `${menuOriginalRect.left}px`; heightOffset = dropUpwards ? (window.innerHeight - menuOriginalRect.top - toggleHeight / 2) : menuOriginalRect.top; } @@ -94,6 +90,7 @@ class DropDown { this.menu.style.position = ''; this.menu.style[this.direction] = ''; this.menu.style.width = ''; + this.menu.style.left = ''; this.container.appendChild(this.menu); } @@ -101,7 +98,7 @@ class DropDown { } getFocusable() { - return Array.from(this.menu.querySelectorAll('[tabindex],[href],button,input:not([type=hidden])')); + return Array.from(this.menu.querySelectorAll('[tabindex]:not([tabindex="-1"]),[href],button,input:not([type=hidden])')); } focusNext() {