Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
xblock-drag-and-drop-v2
Commits
cab18591
Commit
cab18591
authored
Mar 20, 2017
by
Albert St. Aubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated a11y focus after leaving Keyboard help
parent
6a821d66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
drag_and_drop_v2/public/js/drag_and_drop.js
+15
-14
No files found.
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
cab18591
...
@@ -504,7 +504,6 @@ function DragAndDropTemplates(configuration) {
...
@@ -504,7 +504,6 @@ function DragAndDropTemplates(configuration) {
}
}
}
}
var
progress_text
=
progress_template
.
replace
(
'{possible}'
,
formatNumber
(
ctx
.
weighted_max_score
));
var
progress_text
=
progress_template
.
replace
(
'{possible}'
,
formatNumber
(
ctx
.
weighted_max_score
));
return
h
(
'div.problem-progress'
,
{
return
h
(
'div.problem-progress'
,
{
id
:
configuration
.
url_name
+
'-problem-progress'
,
id
:
configuration
.
url_name
+
'-problem-progress'
,
attributes
:
{
role
:
'status'
}
attributes
:
{
role
:
'status'
}
...
@@ -626,7 +625,6 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -626,7 +625,6 @@ function DragAndDropBlock(runtime, element, configuration) {
var
M
=
77
;
var
M
=
77
;
var
$selectedItem
;
var
$selectedItem
;
var
$focusedElement
;
var
init
=
function
()
{
var
init
=
function
()
{
// Load the current user state, and load the image, then render the block.
// Load the current user state, and load the image, then render the block.
...
@@ -706,11 +704,11 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -706,11 +704,11 @@ function DragAndDropBlock(runtime, element, configuration) {
}
}
};
};
var
keyboardEventDispatcher
=
function
(
evt
)
{
var
keyboardEventDispatcher
=
function
(
evt
,
focusId
)
{
if
(
evt
.
which
===
TAB
)
{
if
(
evt
.
which
===
TAB
)
{
trapFocus
(
evt
);
trapFocus
(
evt
);
}
else
if
(
evt
.
which
===
ESC
)
{
}
else
if
(
evt
.
which
===
ESC
)
{
hideKeyboardHelp
(
evt
);
hideKeyboardHelp
(
evt
,
focusId
);
}
}
};
};
...
@@ -788,6 +786,7 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -788,6 +786,7 @@ function DragAndDropBlock(runtime, element, configuration) {
};
};
var
showKeyboardHelp
=
function
(
evt
)
{
var
showKeyboardHelp
=
function
(
evt
)
{
var
focusId
=
document
.
activeElement
;
evt
.
preventDefault
();
evt
.
preventDefault
();
// Show dialog
// Show dialog
...
@@ -795,15 +794,17 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -795,15 +794,17 @@ function DragAndDropBlock(runtime, element, configuration) {
$keyboardHelpDialog
.
find
(
'.modal-window-overlay'
).
show
();
$keyboardHelpDialog
.
find
(
'.modal-window-overlay'
).
show
();
$keyboardHelpDialog
.
find
(
'.modal-window'
).
show
().
focus
();
$keyboardHelpDialog
.
find
(
'.modal-window'
).
show
().
focus
();
// Handle focus
$focusedElement
=
$
(
':focus'
);
// Set up event handlers
// Set up event handlers
$
(
document
).
on
(
'keydown'
,
keyboardEventDispatcher
);
$
(
document
).
on
(
'keydown'
,
function
(
evt
)
{
$keyboardHelpDialog
.
find
(
'.modal-dismiss-button'
).
on
(
'click'
,
hideKeyboardHelp
);
keyboardEventDispatcher
(
evt
,
focusId
);
});
$keyboardHelpDialog
.
find
(
'.modal-dismiss-button'
).
on
(
'click'
,
function
(
evt
)
{
hideKeyboardHelp
(
evt
,
focusId
)
});
};
};
var
hideKeyboardHelp
=
function
(
evt
)
{
var
hideKeyboardHelp
=
function
(
evt
,
focusId
)
{
evt
.
preventDefault
();
evt
.
preventDefault
();
// Hide dialog
// Hide dialog
...
@@ -811,12 +812,12 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -811,12 +812,12 @@ function DragAndDropBlock(runtime, element, configuration) {
$keyboardHelpDialog
.
find
(
'.modal-window-overlay'
).
hide
();
$keyboardHelpDialog
.
find
(
'.modal-window-overlay'
).
hide
();
$keyboardHelpDialog
.
find
(
'.modal-window'
).
hide
();
$keyboardHelpDialog
.
find
(
'.modal-window'
).
hide
();
// Handle focus
$focusedElement
.
focus
();
// Remove event handlers
// Remove event handlers
$
(
document
).
off
(
'keydown'
,
keyboardEventDispatcher
);
$
(
document
).
off
(
'keydown'
);
$keyboardHelpDialog
.
find
(
'.modal-dismiss-button'
).
off
();
$keyboardHelpDialog
.
find
(
'.modal-dismiss-button'
).
off
();
// Handle focus
$
(
focusId
).
focus
();
};
};
/** Asynchronously load the main background image used for this block. */
/** Asynchronously load the main background image used for this block. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment