Skip to content

Commit

Permalink
[SOL-1944] Unique labelledby for modal popups; removed stale button t…
Browse files Browse the repository at this point in the history
…emplate parameters
  • Loading branch information
E. Kolpakov committed Aug 3, 2016
1 parent 44e31bc commit ed8ad0d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drag_and_drop_v2/public/js/drag_and_drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ function DragAndDropTemplates(configuration) {
};

var keyboardHelpPopupTemplate = function(ctx) {
var labelledby_id = 'modal-window-title-'+ctx.block_id;
return (
h('div.keyboard-help-dialog', [
h('div.modal-window-overlay'),
h('div.modal-window', {attributes: {role: 'dialog', 'aria-labelledby': 'modal-window-title'}}, [
h('div.modal-window', {attributes: {role: 'dialog', 'aria-labelledby': labelledby_id}}, [
h('div.modal-header', [
h('h2.modal-window-title#modal-window-title', gettext('Keyboard Help'))
h('h2.modal-window-title#'+labelledby_id, gettext('Keyboard Help'))
]),
h('div.modal-content', [
h('p', gettext('You can complete this problem using only your keyboard.')),
Expand Down Expand Up @@ -236,7 +237,7 @@ function DragAndDropTemplates(configuration) {
);
};

var sidebarButtonTemplate = function(buttonClass, iconClass, buttonText, disabled, tabindex) {
var sidebarButtonTemplate = function(buttonClass, iconClass, buttonText, disabled) {
return (
h('span.sidebar-button-wrapper', {}, [
h(
Expand Down Expand Up @@ -936,6 +937,7 @@ function DragAndDropBlock(runtime, element, configuration) {

var context = {
// configuration - parts that never change:
block_id: $element.data('usage-id').replace(/[+@]/g, "_"),
bg_image_width: bgImgNaturalWidth, // Not stored in configuration since it's unknown on the server side
title_html: configuration.title,
show_title: configuration.show_title,
Expand Down

0 comments on commit ed8ad0d

Please sign in to comment.