Commit 285c07fc by Dave St.Germain

Addressed review feedback.

parent 232df30b
...@@ -17,7 +17,9 @@ define([], function () { ...@@ -17,7 +17,9 @@ define([], function () {
'></div>' '></div>'
); );
state.baseImageEl = $('<img alt="drop target image" />'); state.baseImageEl = $('<img />', {
alt: gettext("Drop target image")
});
state.baseImageEl.attr('src', state.config.baseImage); state.baseImageEl.attr('src', state.config.baseImage);
state.baseImageEl.load(function () { state.baseImageEl.load(function () {
......
...@@ -63,7 +63,6 @@ return { ...@@ -63,7 +63,6 @@ return {
}); });
this.iconEl.appendTo(this.state.baseImageEl.parent()); this.iconEl.appendTo(this.state.baseImageEl.parent());
if (this.labelEl !== null) { if (this.labelEl !== null) {
if (this.isOriginal === true) { if (this.isOriginal === true) {
this.labelEl.detach(); this.labelEl.detach();
...@@ -83,9 +82,10 @@ return { ...@@ -83,9 +82,10 @@ return {
if (this.isOriginal === true) { if (this.isOriginal === true) {
this.state.numDraggablesInSlider -= 1; this.state.numDraggablesInSlider -= 1;
} }
SR.readText(gettext('dragging out of slider')); // SR: global "screen reader" object in accessibility_tools.js
window.SR.readText(gettext('dragging out of slider'));
} else { } else {
SR.readText(gettext('dragging')); window.SR.readText(gettext('dragging'));
} }
this.zIndex = 1000; this.zIndex = 1000;
...@@ -107,9 +107,9 @@ return { ...@@ -107,9 +107,9 @@ return {
this.checkLandingElement(); this.checkLandingElement();
if (this.inContainer === true) { if (this.inContainer === true) {
SR.readText(gettext('dropped in slider')); window.SR.readText(gettext('dropped in slider'));
} else { } else {
SR.readText(gettext('dropped on target')); window.SR.readText(gettext('dropped on target'));
} }
this.toggleTargets(false); this.toggleTargets(false);
} }
......
...@@ -236,15 +236,13 @@ return { ...@@ -236,15 +236,13 @@ return {
return false; return false;
}, },
'toggleTargets': function (onoff) { 'toggleTargets': function (isEnabled) {
var c1, target, effect; var effect = (isEnabled ? 'move' : undefined);
effect = (onoff ? 'move' : undefined);
this.state.baseImageEl.attr('aria-dropeffect', effect); this.state.baseImageEl.attr('aria-dropeffect', effect);
for (c1 = 0; c1 < this.state.targets.length; c1 += 1) { $.each(this.state.targets, function (target) {
target = this.state.targets[c1];
target.targetEl.attr('aria-dropeffect', effect); target.targetEl.attr('aria-dropeffect', effect);
} });
}, },
'snapToTarget': function (target) { 'snapToTarget': function (target) {
......
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