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
ab7f7b74
Commit
ab7f7b74
authored
Dec 07, 2016
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TNL-6031] Added SR-only text notifying user that item is grabbed
parent
292c2baf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
drag_and_drop_v2/public/js/drag_and_drop.js
+9
-2
tests/integration/test_interaction.py
+3
-1
No files found.
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
ab7f7b74
...
...
@@ -53,6 +53,7 @@ function DragAndDropTemplates(configuration) {
var
itemTemplate
=
function
(
item
,
ctx
)
{
// Define properties
var
descriptionClassName
=
"sr description"
;
var
className
=
(
item
.
class_name
)
?
item
.
class_name
:
""
;
var
zone
=
getZone
(
item
.
zone
,
ctx
)
||
{};
if
(
item
.
has_image
)
{
...
...
@@ -118,18 +119,24 @@ function DragAndDropTemplates(configuration) {
}
var
item_description
=
h
(
'div'
,
{
key
:
item
.
value
+
'-description'
,
id
:
item_description_id
,
className
:
'sr'
},
{
key
:
item
.
value
+
'-description'
,
id
:
item_description_id
,
className
:
descriptionClassName
},
description_content
);
}
else
{
var
item_description
=
h
(
'div'
,
{
id
:
item_description_id
,
className
:
'sr'
},
{
id
:
item_description_id
,
className
:
descriptionClassName
},
gettext
(
'Press "Enter", "Space", "Ctrl-m", or "⌘-m" on an item to select it for dropping, then navigate to the zone you want to drop it on.'
)
);
}
children
.
splice
(
1
,
0
,
item_description
);
children
.
splice
(
1
,
0
,
item_content
);
if
(
item
.
grabbed
)
{
var
itemGrabbedSRNote
=
h
(
'span'
,
{
className
:
'sr dragged'
},
gettext
(
"draggable, grabbed"
));
children
.
splice
(
2
,
0
,
itemGrabbedSRNote
);
}
return
(
h
(
'div.option'
,
...
...
tests/integration/test_interaction.py
View file @
ab7f7b74
...
...
@@ -238,7 +238,9 @@ class StandardInteractionTest(DefaultDataTestMixin, InteractionTestBase, Paramet
ActionChains
(
self
.
browser
)
.
move_to_element
(
item
)
.
perform
()
keyboard_help_text
=
(
u'Press "Enter", "Space", "Ctrl-m", or "⌘-m" on an item to select it for dropping, '
'then navigate to the zone you want to drop it on.'
)
self
.
assertEqual
(
item
.
find_element_by_css_selector
(
'.sr'
)
.
text
,
keyboard_help_text
)
self
.
assertEqual
(
item
.
find_element_by_css_selector
(
'.sr.description'
)
.
text
,
keyboard_help_text
)
expected_sr_text
=
"draggable, grabbed"
self
.
assertEqual
(
item
.
find_element_by_css_selector
(
'.sr.dragged'
)
.
text
,
expected_sr_text
)
def
test_alt_text_for_zones
(
self
):
self
.
_get_popup
()
...
...
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