Commit 0c4db58c by E. Kolpakov

[TNL-6022] Added SR-only keyboard help button to the front of the problem.

parent 1f6e1892
...@@ -2,6 +2,9 @@ function DragAndDropTemplates(configuration) { ...@@ -2,6 +2,9 @@ function DragAndDropTemplates(configuration) {
"use strict"; "use strict";
var h = virtualDom.h; var h = virtualDom.h;
var keyboardHelpButtonClass = "keyboard-help-button";
var keyboardHelpText = gettext('Keyboard Help');
var itemSpinnerTemplate = function(item) { var itemSpinnerTemplate = function(item) {
if (!item.xhr_active) { if (!item.xhr_active) {
return null; return null;
...@@ -380,7 +383,7 @@ function DragAndDropTemplates(configuration) { ...@@ -380,7 +383,7 @@ function DragAndDropTemplates(configuration) {
} }
return( return(
h("section.action-toolbar-item.sidebar-buttons", {}, [ h("section.action-toolbar-item.sidebar-buttons", {}, [
sidebarButtonTemplate("keyboard-help-button", "fa-question", gettext('Keyboard Help')), sidebarButtonTemplate(keyboardHelpButtonClass, "fa-question", keyboardHelpText),
sidebarButtonTemplate("reset-button", "fa-refresh", gettext('Reset'), ctx.disable_reset_button), sidebarButtonTemplate("reset-button", "fa-refresh", gettext('Reset'), ctx.disable_reset_button),
showAnswerButton, showAnswerButton,
]) ])
...@@ -451,6 +454,10 @@ function DragAndDropTemplates(configuration) { ...@@ -451,6 +454,10 @@ function DragAndDropTemplates(configuration) {
) )
}; };
var forwardKeyboardHelpButtonTemplate = function(ctx) {
return h("button", { attributes: {tabindex: 0}, className: keyboardHelpButtonClass }, keyboardHelpText);
};
var progressTemplate = function(ctx) { var progressTemplate = function(ctx) {
// Formats a number to 4 decimals without trailing zeros // Formats a number to 4 decimals without trailing zeros
// (1.00 -> '1'; 1.50 -> '1.5'; 1.333333333 -> '1.3333'). // (1.00 -> '1'; 1.50 -> '1.5'; 1.333333333 -> '1.3333').
...@@ -531,6 +538,7 @@ function DragAndDropTemplates(configuration) { ...@@ -531,6 +538,7 @@ function DragAndDropTemplates(configuration) {
problemHeader, problemHeader,
h('p', {innerHTML: ctx.problem_html}), h('p', {innerHTML: ctx.problem_html}),
]), ]),
h('div', {'className': 'sr'}, [forwardKeyboardHelpButtonTemplate(ctx)]),
h('section.drag-container', {}, [ h('section.drag-container', {}, [
h('div.item-bank', item_bank_properties, [ h('div.item-bank', item_bank_properties, [
h('p', { className: 'zone-description sr' }, gettext('Item Bank')), h('p', { className: 'zone-description sr' }, gettext('Item Bank')),
......
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