A more natural tabindex

HFJ-1549
pull/17/head
Frode Petterson 2016-03-17 14:22:23 +01:00
parent b8a3965c6e
commit 14605dc790
1 changed files with 6 additions and 6 deletions

View File

@ -139,7 +139,7 @@ H5P.init = function (target) {
// Check if we should add and display a fullscreen button for this H5P. // Check if we should add and display a fullscreen button for this H5P.
if (contentData.fullScreen == 1 && H5P.canHasFullScreen) { if (contentData.fullScreen == 1 && H5P.canHasFullScreen) {
H5P.jQuery('<div class="h5p-content-controls"><div role="button" tabindex="1" class="h5p-enable-fullscreen" title="' + H5P.t('fullscreen') + '"></div></div>').prependTo($container).children().click(function () { H5P.jQuery('<div class="h5p-content-controls"><div role="button" tabindex="0" class="h5p-enable-fullscreen" title="' + H5P.t('fullscreen') + '"></div></div>').prependTo($container).children().click(function () {
H5P.fullScreen($container, instance); H5P.fullScreen($container, instance);
}); });
} }
@ -148,7 +148,7 @@ H5P.init = function (target) {
var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>'); var $actions = H5P.jQuery('<ul class="h5p-actions"></ul>');
if (!(contentData.disable & H5P.DISABLE_DOWNLOAD)) { if (!(contentData.disable & H5P.DISABLE_DOWNLOAD)) {
// Add export button // Add export button
H5P.jQuery('<li class="h5p-button h5p-export" role="button" tabindex="1" title="' + H5P.t('downloadDescription') + '">' + H5P.t('download') + '</li>').appendTo($actions).click(function () { H5P.jQuery('<li class="h5p-button h5p-export" role="button" tabindex="0" title="' + H5P.t('downloadDescription') + '">' + H5P.t('download') + '</li>').appendTo($actions).click(function () {
window.location.href = contentData.exportUrl; window.location.href = contentData.exportUrl;
}); });
} }
@ -157,7 +157,7 @@ H5P.init = function (target) {
if (copyright) { if (copyright) {
// Add copyright dialog button // Add copyright dialog button
H5P.jQuery('<li class="h5p-button h5p-copyrights" role="button" tabindex="1" title="' + H5P.t('copyrightsDescription') + '">' + H5P.t('copyrights') + '</li>').appendTo($actions).click(function () { H5P.jQuery('<li class="h5p-button h5p-copyrights" role="button" tabindex="0" title="' + H5P.t('copyrightsDescription') + '">' + H5P.t('copyrights') + '</li>').appendTo($actions).click(function () {
// Open dialog with copyright information // Open dialog with copyright information
var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyright, $container); var dialog = new H5P.Dialog('copyrights', H5P.t('copyrightInformation'), copyright, $container);
dialog.open(); dialog.open();
@ -166,7 +166,7 @@ H5P.init = function (target) {
} }
if (!(contentData.disable & H5P.DISABLE_EMBED)) { if (!(contentData.disable & H5P.DISABLE_EMBED)) {
// Add embed button // Add embed button
H5P.jQuery('<li class="h5p-button h5p-embed" role="button" tabindex="1" title="' + H5P.t('embedDescription') + '">' + H5P.t('embed') + '</li>').appendTo($actions).click(function () { H5P.jQuery('<li class="h5p-button h5p-embed" role="button" tabindex="0" title="' + H5P.t('embedDescription') + '">' + H5P.t('embed') + '</li>').appendTo($actions).click(function () {
H5P.openEmbedDialog($actions, contentData.embedCode, contentData.resizeCode, { H5P.openEmbedDialog($actions, contentData.embedCode, contentData.resizeCode, {
width: $element.width(), width: $element.width(),
height: $element.height() height: $element.height()
@ -545,7 +545,7 @@ H5P.fullScreen = function ($element, instance, exitCallback, body) {
} }
before('h5p-semi-fullscreen'); before('h5p-semi-fullscreen');
var $disable = H5P.jQuery('<div role="button" tabindex="1" class="h5p-disable-fullscreen" title="' + H5P.t('disableFullscreen') + '"></div>').appendTo($container.find('.h5p-content-controls')); var $disable = H5P.jQuery('<div role="button" tabindex="0" class="h5p-disable-fullscreen" title="' + H5P.t('disableFullscreen') + '"></div>').appendTo($container.find('.h5p-content-controls'));
var keyup, disableSemiFullscreen = H5P.exitFullScreen = function () { var keyup, disableSemiFullscreen = H5P.exitFullScreen = function () {
if (prevViewportContent) { if (prevViewportContent) {
// Use content from the previous viewport tag // Use content from the previous viewport tag
@ -887,7 +887,7 @@ H5P.Dialog = function (name, title, content, $element) {
<div class="h5p-inner">\ <div class="h5p-inner">\
<h2>' + title + '</h2>\ <h2>' + title + '</h2>\
<div class="h5p-scroll-content">' + content + '</div>\ <div class="h5p-scroll-content">' + content + '</div>\
<div class="h5p-close" role="button" tabindex="1" title="' + H5P.t('close') + '">\ <div class="h5p-close" role="button" tabindex="0" title="' + H5P.t('close') + '">\
</div>\ </div>\
</div>') </div>')
.insertAfter($element) .insertAfter($element)