Skip to content

Commit

Permalink
HFP-3584 H5P actionbar: Fix semantics + stop using title (h5p#133)
Browse files Browse the repository at this point in the history
* HFP-3548 Implement H5P.Tooltip

* HFP-3548 Improve code and avoid duplication

* HFP-3548 Implement configurable position for tooltip

* HFP-3548 Add positional css to tooltip

* HFP-3584 Add accessible tooltip to action-bar

Co-authored-by: Pål Jørgensen <[email protected]>
  • Loading branch information
VildeStabell and fnoks authored Aug 15, 2022
1 parent 573d1ba commit 60f7a9e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/h5p-action-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ H5P.ActionBar = (function ($, EventDispatcher) {
var handler = function () {
self.trigger(type);
};
var $actionButton = H5P.jQuery('<li/>', {

let $actionList = H5P.jQuery('<li/>', {
'class': 'h5p-button h5p-noselect h5p-' + (customClass ? customClass : type),
appendTo: $actions
});

H5P.jQuery('<button/>', {
tabindex: 0,
title: H5P.t(type + 'Description'),
'aria-label': H5P.t(type + 'Description'),
html: H5P.t(type),
on: {
click: handler,
Expand All @@ -53,9 +54,11 @@ H5P.ActionBar = (function ($, EventDispatcher) {
}
}
},
appendTo: $actionButton
appendTo: $actionList
});

new H5P.Tooltip($actionButton.get(0));

hasActions = true;
};

Expand Down

0 comments on commit 60f7a9e

Please sign in to comment.