Skip to content
Snippets Groups Projects
Commit 3889963b authored by Moritz Strohm's avatar Moritz Strohm
Browse files

added another possibility for tooltip content

parent de8dea17
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,11 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti ...@@ -24,7 +24,11 @@ $(document).on('mouseenter mouseleave focusin focusout', '[data-tooltip],.toolti
// If tooltip has not yet been created (first hover), obtain it's // If tooltip has not yet been created (first hover), obtain it's
// contents and create the actual tooltip object. // contents and create the actual tooltip object.
if (!data.tooltip || !$.isPlainObject(data.tooltip)) { if (!data.tooltip || !$.isPlainObject(data.tooltip)) {
let describing_element = $('#' + $(this).attr('aria-describedby'));
content = $('<div/>').text(data.tooltip || $(this).attr('title')).html(); content = $('<div/>').text(data.tooltip || $(this).attr('title')).html();
if (!content && describing_element) {
content = $(describing_element).html();
}
} else if (data.tooltip.html !== undefined) { } else if (data.tooltip.html !== undefined) {
content = data.tooltip.html; content = data.tooltip.html;
} else if (data.tooltip.text !== undefined) { } else if (data.tooltip.text !== undefined) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment