Commit d20adb7e by E. Kolpakov

[TNL-6026] Item bank SR help text moved to ARIA-label + appropriate role is set up.

parent 5bc7c901
...@@ -519,14 +519,17 @@ function DragAndDropTemplates(configuration) { ...@@ -519,14 +519,17 @@ function DragAndDropTemplates(configuration) {
var is_item_placed = function(i) { return i.is_placed; }; var is_item_placed = function(i) { return i.is_placed; };
var items_placed = $.grep(ctx.items, is_item_placed); var items_placed = $.grep(ctx.items, is_item_placed);
var items_in_bank = $.grep(ctx.items, is_item_placed, true); var items_in_bank = $.grep(ctx.items, is_item_placed, true);
var item_bank_properties = {}; var item_bank_properties = {
attributes: {
'role': 'group',
'aria-label': gettext('Item Bank')
}
};
if (ctx.item_bank_focusable) { if (ctx.item_bank_focusable) {
item_bank_properties.attributes = { item_bank_properties.attributes['tabindex'] = 0;
'tabindex': 0, item_bank_properties.attributes['dropzone'] = 'move';
'dropzone': 'move', item_bank_properties.attributes['aria-dropeffect'] = 'move';
'aria-dropeffect': 'move', item_bank_properties.attributes['role'] = 'button';
'role': 'button'
};
} }
return ( return (
h('section.themed-xblock.xblock--drag-and-drop', [ h('section.themed-xblock.xblock--drag-and-drop', [
...@@ -539,7 +542,6 @@ function DragAndDropTemplates(configuration) { ...@@ -539,7 +542,6 @@ function DragAndDropTemplates(configuration) {
h('div', {'className': 'sr'}, [forwardKeyboardHelpButtonTemplate(ctx)]), 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')),
renderCollection(itemTemplate, items_in_bank, ctx), renderCollection(itemTemplate, items_in_bank, ctx),
renderCollection(itemPlaceholderTemplate, items_placed, ctx) renderCollection(itemPlaceholderTemplate, items_placed, ctx)
]), ]),
......
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