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
3066fdbb
Commit
3066fdbb
authored
Jan 28, 2016
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better accessibility for feedback popups and higher contrast for dropped items.
parent
b7d1134a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
24 deletions
+44
-24
drag_and_drop_v2/public/css/drag_and_drop.css
+34
-16
drag_and_drop_v2/public/js/drag_and_drop.js
+1
-0
drag_and_drop_v2/public/js/view.js
+7
-6
tests/integration/test_render.py
+2
-2
No files found.
drag_and_drop_v2/public/css/drag_and_drop.css
View file @
3066fdbb
...
@@ -9,6 +9,34 @@
...
@@ -9,6 +9,34 @@
margin-right
:
3px
;
margin-right
:
3px
;
}
}
/* Button style tricks, defined higher so they can be overridden */
.xblock--drag-and-drop
.unbutton
{
background
:
none
;
box-shadow
:
none
;
border
:
none
;
padding
:
0
;
margin
:
0
;
}
.xblock--drag-and-drop
.unbutton
:active
{
background
:
none
;
box-shadow
:
none
;
border
:
none
;
}
.xblock--drag-and-drop
.unbutton
:hover
{
background
:
none
;
box-shadow
:
none
;
border
:
none
;
}
.xblock--drag-and-drop
.unbutton
:focus
{
background
:
none
;
box-shadow
:
none
;
border
:
none
;
}
/* Header, instruction text, etc. */
/* Header, instruction text, etc. */
.xblock--drag-and-drop
.problem-title
{
.xblock--drag-and-drop
.problem-title
{
...
@@ -180,7 +208,7 @@
...
@@ -180,7 +208,7 @@
}
}
.xblock--drag-and-drop
.drag-container
.option.fade
{
.xblock--drag-and-drop
.drag-container
.option.fade
{
opacity
:
0.
5
;
opacity
:
0.
80
;
}
}
/*** DROP TARGET ***/
/*** DROP TARGET ***/
...
@@ -299,6 +327,10 @@
...
@@ -299,6 +327,10 @@
font-size
:
18pt
;
font-size
:
18pt
;
}
}
.xblock--drag-and-drop
.popup
.close
:focus
{
outline
:
2px
solid
white
;
}
/*** KEYBOARD HELP ***/
/*** KEYBOARD HELP ***/
.xblock--drag-and-drop
.keyboard-help
{
.xblock--drag-and-drop
.keyboard-help
{
...
@@ -373,21 +405,7 @@
...
@@ -373,21 +405,7 @@
}
}
.xblock--drag-and-drop
.link-button
:focus
{
.xblock--drag-and-drop
.link-button
:focus
{
background
:
none
;
outline
:
2px
solid
#2d74b3
;
box-shadow
:
none
;
border
:
none
;
}
.xblock--drag-and-drop
.link-button
:active
{
background
:
none
;
box-shadow
:
none
;
border
:
none
;
}
.xblock--drag-and-drop
.link-button
:hover
{
background
:
none
;
box-shadow
:
none
;
border
:
none
;
}
}
/* Make sure screen-reader content is hidden in the workbench: */
/* Make sure screen-reader content is hidden in the workbench: */
...
...
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
3066fdbb
...
@@ -237,6 +237,7 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -237,6 +237,7 @@ function DragAndDropBlock(runtime, element, configuration) {
updateDOM
();
updateDOM
();
destroyDraggable
();
destroyDraggable
();
$element
.
find
(
'div.popup'
).
focus
()
if
(
!
state
.
finished
)
{
if
(
!
state
.
finished
)
{
initDraggable
();
initDraggable
();
}
}
...
...
drag_and_drop_v2/public/js/view.js
View file @
3066fdbb
...
@@ -174,7 +174,7 @@
...
@@ -174,7 +174,7 @@
return
(
return
(
h
(
'section.feedback'
,
properties
,
[
h
(
'section.feedback'
,
properties
,
[
h
(
h
(
'button.reset-button.link-button'
,
'button.reset-button.
unbutton.
link-button'
,
{
style
:
{
display
:
reset_button_display
},
attributes
:
{
tabindex
:
0
},
'aria-live'
:
'off'
},
{
style
:
{
display
:
reset_button_display
},
attributes
:
{
tabindex
:
0
},
'aria-live'
:
'off'
},
gettext
(
'Reset problem'
)
gettext
(
'Reset problem'
)
),
),
...
@@ -189,7 +189,7 @@
...
@@ -189,7 +189,7 @@
var
dialog_style
=
{};
var
dialog_style
=
{};
return
(
return
(
h
(
'section.keyboard-help'
,
[
h
(
'section.keyboard-help'
,
[
h
(
'button.keyboard-help-button.link-button'
,
{
attributes
:
{
tabindex
:
0
}
},
gettext
(
'Keyboard Help'
)),
h
(
'button.keyboard-help-button.
unbutton.
link-button'
,
{
attributes
:
{
tabindex
:
0
}
},
gettext
(
'Keyboard Help'
)),
h
(
'div.keyboard-help-dialog'
,
[
h
(
'div.keyboard-help-dialog'
,
[
h
(
'div.modal-window-overlay'
),
h
(
'div.modal-window-overlay'
),
h
(
'div.modal-window'
,
{
attributes
:
dialog_attributes
,
style
:
dialog_style
},
[
h
(
'div.modal-window'
,
{
attributes
:
dialog_attributes
,
style
:
dialog_style
},
[
...
@@ -231,21 +231,22 @@
...
@@ -231,21 +231,22 @@
problemHeader
,
problemHeader
,
h
(
'p'
,
{
innerHTML
:
ctx
.
problem_html
}),
h
(
'p'
,
{
innerHTML
:
ctx
.
problem_html
}),
]),
]),
h
(
'section.drag-container'
,
[
h
(
'section.drag-container'
,
{
attributes
:
{
role
:
'application'
}
},
[
h
(
h
(
'div.item-bank'
,
'div.item-bank'
,
{
attributes
:
{
role
:
'application'
}
},
renderCollection
(
itemTemplate
,
items_in_bank
,
ctx
)
renderCollection
(
itemTemplate
,
items_in_bank
,
ctx
)
),
),
h
(
'div.target'
,
[
h
(
'div.target'
,
[
h
(
h
(
popupSelector
,
popupSelector
,
{
{
attributes
:
{
'aria-live'
:
'polite'
},
attributes
:
{
'aria-live'
:
'polite'
,
'tabindex'
:
0
},
style
:
{
display
:
ctx
.
popup_html
?
'block'
:
'none'
},
style
:
{
display
:
ctx
.
popup_html
?
'block'
:
'none'
},
},
},
[
[
h
(
'div.close.icon-remove-sign.fa-times-circle'
),
h
(
'button.unbutton.close.icon-remove-sign.fa-times-circle'
,
[
h
(
'div'
,
{
attributes
:
{
'class'
:
'sr'
}},
gettext
(
"Close"
))
]),
h
(
'p.popup-content'
,
{
innerHTML
:
ctx
.
popup_html
}),
h
(
'p.popup-content'
,
{
innerHTML
:
ctx
.
popup_html
}),
]
]
),
),
...
...
tests/integration/test_render.py
View file @
3066fdbb
...
@@ -165,9 +165,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
...
@@ -165,9 +165,9 @@ class TestDragAndDropRender(BaseIntegrationTest):
'This describes the background image of item {}'
.
format
(
item_number
)
'This describes the background image of item {}'
.
format
(
item_number
)
)
)
def
test_
item_bank
(
self
):
def
test_
drag_container
(
self
):
self
.
load_scenario
()
self
.
load_scenario
()
item_bank
=
self
.
_page
.
find_element_by_css_selector
(
'.
item-bank
'
)
item_bank
=
self
.
_page
.
find_element_by_css_selector
(
'.
drag-container
'
)
self
.
assertEqual
(
item_bank
.
get_attribute
(
'role'
),
'application'
)
self
.
assertEqual
(
item_bank
.
get_attribute
(
'role'
),
'application'
)
def
test_zones
(
self
):
def
test_zones
(
self
):
...
...
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