diff options
| author | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-01-26 13:31:43 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-01-26 13:31:43 +0100 |
| commit | d42519557062dc1bbd2a686ae79597cd1626a67e (patch) | |
| tree | 1fb77bd43c5215fe108b288349ffadf9e12ffbdb | |
| parent | f9fc61f85846a2f54d999d369ec8a9f8ead22275 (diff) | |
fix correctly, re #3664biest-3664
| -rw-r--r-- | resources/assets/javascripts/studip-ui.js | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/resources/assets/javascripts/studip-ui.js b/resources/assets/javascripts/studip-ui.js index 05d0a9b..72e30ca 100644 --- a/resources/assets/javascripts/studip-ui.js +++ b/resources/assets/javascripts/studip-ui.js @@ -568,10 +568,8 @@ import eventBus from "./lib/event-bus.ts"; return; } - $(input).css({ - 'position': 'relative', - 'z-index': 1002 - }); + input.style.zIndex = input.closest('.ui-dialog') ? 1002 : 1000; + input.style.position = 'relative'; }, showButtonPanel: true, onSelect: function (value, instance) { @@ -593,18 +591,14 @@ import eventBus from "./lib/event-bus.ts"; } $(window).bind('scroll.datepicker-scroll', _.debounce($.proxy(DpHideOnScroll, null, input), 100, {leading:true, trailing:false})); - if (input.closest('#sidebar')) { - const button = input.nextElementSibling; - if (button && button.matches('input[type="submit"]')) { - button.style.position = 'relative'; - button.style.zIndex = input.style.zIndex; - } + if ($(input).closest('#sidebar').length === 0) { + return; } - // Prevent element from overlapping the upper blue bar - const topBar = document.querySelector('#top-bar'); - if (topBar && !input.closest('.ui-dialog')) { - input.style.zIndex = window.getComputedStyle(topBar).zIndex - 1; + const button = input.nextElementSibling; + if (button && button.matches('input[type="submit"]')) { + button.style.position = 'relative'; + button.style.zIndex = input.style.zIndex; } }, onClose (date, inst) { |
