Skip to content

Commit

Permalink
Update: a11y updates (fixes #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster authored Jun 20, 2023
2 parents 3b226a2 + bf3d365 commit 9d427a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
### any json - single instance definition
```json
{
"body": "This next <span definition='Has a brief description'>word</span>"
"body": "This next <span role='button' tabindex='0' definition='Has a brief description'>word</span>"
}
```

Expand Down
9 changes: 6 additions & 3 deletions js/adapt-definitions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
define([
'core/js/adapt',
'handlebars',
'core/js/accessibility'
'handlebars'
],function(Adapt, Handlebars) {

function escapeRegExp(text) {
Expand All @@ -27,6 +26,10 @@ define([
this.listenTo(Adapt, "app:dataLoaded", this.loadData);

$('body').on('click', "[definition]", this.onAbbrClick);
$('body').on('keypress', "[definition]", e => {
if (e.which !== 13 ) return;
this.onAbbrClick(e);
});
},

loadData: function() {
Expand Down Expand Up @@ -143,7 +146,7 @@ define([
var title = Handlebars.compile(this.model.get("title"))(json);
var body = Handlebars.compile(this.model.get("body"))(json);

Adapt.trigger("notify:prompt", {
Adapt.notify.popup({
"title": title,
"body": "<div no-definition=\"true\">"+body+"</div>",
"_prompts": [
Expand Down

0 comments on commit 9d427a6

Please sign in to comment.