aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-02-11 08:01:50 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2025-02-11 08:01:50 +0000
commit5a4b76f3ddfc10381a2636790b2372fb956c99b6 (patch)
treea31a517f01d8274637af76cfd8b058e37cbeed78 /resources/assets/javascripts/lib
parente92e6f89729b6188562c30fe8ade261256dc07f9 (diff)
prevent tooltips in dialogs from being automatically focussed, fixes #773
Closes #773 Merge request studip/studip!3919
Diffstat (limited to 'resources/assets/javascripts/lib')
-rw-r--r--resources/assets/javascripts/lib/dialog.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/resources/assets/javascripts/lib/dialog.js b/resources/assets/javascripts/lib/dialog.js
index 2810319..3459705 100644
--- a/resources/assets/javascripts/lib/dialog.js
+++ b/resources/assets/javascripts/lib/dialog.js
@@ -382,9 +382,16 @@ Dialog.show = function(content, options = {}) {
instance.fixedDimensions = true;
instance.dimensions = ui.size;
},
- open() {
+ open(event) {
PageLayout.title = dialog_options.title;
+ // Prevent tooltips from being automatically focussed
+ if (event.target.querySelector('[autofocus]') === null) {
+ $(':tabbable.tooltip:focus').data('tooltipObject')?.hide();
+ $(':tabbable:not(.tooltip):first', event.target).trigger('focus');
+ }
+
+ // Adjust titlebar of dialog
const helpbar_element = $('.helpbar a[href*="hilfe.studip.de"]');
const tooltip = helpbar_element.text();
const link = options.wiki_link || helpbar_element.attr('href');