Commit dd85524d authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review

Merge "Bug 1568619: Allowing openbadge info modal to open via enter key"

parents 95d27e0b e9f806db
......@@ -186,7 +186,7 @@ class PluginBlocktypeOpenbadgedisplayer extends SystemBlocktype {
continue;
}
$html .= '<img '
$html .= '<img tabindex="0" id="' . (preg_replace('/\:/', '_', $group)) . '" '
. 'src="' . $b->image . '" '
. 'title="' . $b->name . '" '
. 'data-assertion="' . htmlentities(json_encode($badge->assertion)) . '" />';
......
......@@ -6,6 +6,14 @@
$('#openbadges{{$id}}').on('click', 'img', function () {
showBadgeContent({html: buildBadgeContent($(this).data('assertion'))});
});
$('#openbadges{{$id}}').on('keypress', 'img', function (event) {
if (event.keyCode == 13) {
showBadgeContent({html: buildBadgeContent($(this).data('assertion'))});
$('#badge-content-dialog').on("hidden.bs.modal", function () {
$('#' + $(event.target).attr('id')).focus();
});
}
});
});
})(jQuery);
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment