Skip to content

Commit

Permalink
Merge pull request #590 from matematikk-mooc/marius/DIT-439
Browse files Browse the repository at this point in the history
DIT-439: Hints.
  • Loading branch information
mdl314 authored Dec 11, 2024
2 parents 22d9245 + b0be103 commit 5f33d08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/js/modules/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default (function() {
var tooltipSpan = document.createElement("span");
tooltipSpan.classList.add("tooltip");
tooltipSpan.id = "tooltip-" + count;

var textSpan = document.createElement("span");
textSpan.classList.add("tooltiptext-box");
textSpan.id = "tooltiptext-box-" + count;
Expand All @@ -46,14 +46,13 @@ export default (function() {
tooltipSpan.appendChild(underLineSpan);
tooltipSpan.appendChild(questionMarkSpan);
tooltipSpan.appendChild(textSpan);


el.innerHTML = el.innerHTML.replace(matches[0], tooltipSpan.outerHTML);
matches = re.exec(el.innerHTML);
count++;
}
for (var j = 0; j < count; j++) {
var tooltip = document.getElementById("tooltip-" + j);
tooltip.tabIndex = 1;
tooltip.addEventListener("click", function (e) {
e.stopPropagation();
var tooltipText = this.querySelector(".tooltiptext-box");
Expand Down
6 changes: 6 additions & 0 deletions src/vue/design/re-styles/tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
display: inline-flex;
}

.tooltip:focus-visible {
outline: 3px solid dimgray;
.tooltiptext-box {
display: inline !important;
}
}

.tooltip-underline {
border-bottom: 0.5px dashed #00468E;
Expand Down

0 comments on commit 5f33d08

Please sign in to comment.