Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx
edx-platform
Commits
232df30b
Commit
232df30b
authored
Apr 07, 2014
by
Dave St.Germain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support aria-grabbed and aria-dropeffect
parent
f4391b5e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
13 deletions
+33
-13
common/lib/capa/capa/templates/drag_and_drop_input.html
+1
-1
common/static/js/capa/drag_and_drop/base_image.js
+1
-1
common/static/js/capa/drag_and_drop/draggable_events.js
+12
-3
common/static/js/capa/drag_and_drop/draggable_logic.js
+11
-0
common/static/js/capa/drag_and_drop/draggables.js
+6
-4
common/static/js/capa/drag_and_drop/targets.js
+2
-4
No files found.
common/lib/capa/capa/templates/drag_and_drop_input.html
View file @
232df30b
<div
id=
"inputtype_${id}"
class=
"capa_inputtype"
role=
"application"
>
<div
id=
"inputtype_${id}"
class=
"capa_inputtype"
>
<div
class=
"drag_and_drop_problem_div"
id=
"drag_and_drop_div_${id}"
data-plain-id=
"${id}"
>
</div>
...
...
common/static/js/capa/drag_and_drop/base_image.js
View file @
232df30b
...
...
@@ -17,7 +17,7 @@ define([], function () {
'></div>'
);
state
.
baseImageEl
=
$
(
'<img alt="drop target" />'
);
state
.
baseImageEl
=
$
(
'<img alt="drop target
image
" />'
);
state
.
baseImageEl
.
attr
(
'src'
,
state
.
config
.
baseImage
);
state
.
baseImageEl
.
load
(
function
()
{
...
...
common/static/js/capa/drag_and_drop/draggable_events.js
View file @
232df30b
...
...
@@ -28,7 +28,6 @@ return {
if
(
this
.
numDraggablesOnMe
>
0
)
{
return
;
}
this
.
containerEl
.
attr
(
'aria-grabbed'
,
'true'
);
// If this draggable is just being dragged out of the
// container, we must perform some additional tasks.
...
...
@@ -84,6 +83,9 @@ return {
if
(
this
.
isOriginal
===
true
)
{
this
.
state
.
numDraggablesInSlider
-=
1
;
}
SR
.
readText
(
gettext
(
'dragging out of slider'
));
}
else
{
SR
.
readText
(
gettext
(
'dragging'
));
}
this
.
zIndex
=
1000
;
...
...
@@ -91,7 +93,8 @@ return {
if
(
this
.
labelEl
!==
null
)
{
this
.
labelEl
.
css
(
'z-index'
,
'1000'
);
}
this
.
iconEl
.
attr
(
'aria-grabbed'
,
'true'
).
focus
();
this
.
toggleTargets
(
true
);
this
.
mousePressed
=
true
;
this
.
state
.
currentMovingDraggable
=
this
;
}
...
...
@@ -100,9 +103,15 @@ return {
'mouseUp'
:
function
()
{
if
(
this
.
mousePressed
===
true
)
{
this
.
state
.
currentMovingDraggable
=
null
;
this
.
container
El
.
attr
(
'aria-grabbed'
,
'false'
);
this
.
icon
El
.
attr
(
'aria-grabbed'
,
'false'
);
this
.
checkLandingElement
();
if
(
this
.
inContainer
===
true
)
{
SR
.
readText
(
gettext
(
'dropped in slider'
));
}
else
{
SR
.
readText
(
gettext
(
'dropped on target'
));
}
this
.
toggleTargets
(
false
);
}
},
...
...
common/static/js/capa/drag_and_drop/draggable_logic.js
View file @
232df30b
...
...
@@ -236,6 +236,17 @@ return {
return
false
;
},
'toggleTargets'
:
function
(
onoff
)
{
var
c1
,
target
,
effect
;
effect
=
(
onoff
?
'move'
:
undefined
);
this
.
state
.
baseImageEl
.
attr
(
'aria-dropeffect'
,
effect
);
for
(
c1
=
0
;
c1
<
this
.
state
.
targets
.
length
;
c1
+=
1
)
{
target
=
this
.
state
.
targets
[
c1
];
target
.
targetEl
.
attr
(
'aria-dropeffect'
,
effect
);
}
},
'snapToTarget'
:
function
(
target
)
{
var
offset
;
...
...
common/static/js/capa/drag_and_drop/draggables.js
View file @
232df30b
...
...
@@ -153,8 +153,6 @@ define(['js/capa/drag_and_drop/draggable_events', 'js/capa/drag_and_drop/draggab
'mouseDown'
:
draggableEvents
.
mouseDown
,
'mouseUp'
:
draggableEvents
.
mouseUp
,
'mouseMove'
:
draggableEvents
.
mouseMove
,
'keydown'
:
draggableEvents
.
keyDown
,
'keyup'
:
draggableEvents
.
keyDown
,
'checkLandingElement'
:
draggableLogic
.
checkLandingElement
,
'checkIfOnTarget'
:
draggableLogic
.
checkIfOnTarget
,
...
...
@@ -162,6 +160,7 @@ define(['js/capa/drag_and_drop/draggable_events', 'js/capa/drag_and_drop/draggab
'correctZIndexes'
:
draggableLogic
.
correctZIndexes
,
'moveBackToSlider'
:
draggableLogic
.
moveBackToSlider
,
'moveDraggableTo'
:
draggableLogic
.
moveDraggableTo
,
'toggleTargets'
:
draggableLogic
.
toggleTargets
,
'makeDraggableCopy'
:
makeDraggableCopy
,
...
...
@@ -183,9 +182,9 @@ define(['js/capa/drag_and_drop/draggable_events', 'js/capa/drag_and_drop/draggab
'border-right: 1px solid #CCC; '
+
'text-align: center; '
+
'position: relative; '
+
'cursor:
pointer
; '
+
'cursor:
move
; '
+
'" '
+
'
tabindex="0" aria-grabbed="false"
role="listitem"></div>'
'role="listitem"></div>'
);
draggableObj
.
containerEl
.
appendTo
(
state
.
sliderEl
);
...
...
@@ -240,6 +239,7 @@ define(['js/capa/drag_and_drop/draggable_events', 'js/capa/drag_and_drop/draggab
'position: absolute; '
+
'color: black; '
+
'font-size: 0.95em; '
+
'cursor: move; '
+
'" '
+
'>'
+
obj
.
label
+
...
...
@@ -279,7 +279,9 @@ define(['js/capa/drag_and_drop/draggable_events', 'js/capa/drag_and_drop/draggab
'position: absolute; '
+
'color: black; '
+
'font-size: 0.95em; '
+
'cursor: move; '
+
'" '
+
'tabindex="0" aria-grabbed="false" role="listitem"'
+
'>'
+
obj
.
label
+
'</div>'
...
...
common/static/js/capa/drag_and_drop/targets.js
View file @
232df30b
...
...
@@ -86,9 +86,8 @@ define([], function () {
'left: '
+
obj
.
x
+
'px; '
+
borderCss
+
'" '
+
'></div>'
'
aria-dropeffect=""
></div>'
);
if
(
fromTargetField
===
true
)
{
targetEl
.
appendTo
(
draggableObj
.
iconEl
);
}
else
{
...
...
@@ -115,9 +114,8 @@ define([], function () {
'background-color: white; '
+
'font-size: 0.95em; '
+
'color: #009fe2; '
+
'cursor: pointer; '
+
'" '
+
'
aria-dropeffect="move"
>0</div>'
'>0</div>'
);
}
else
{
numTextEl
=
null
;
...
...
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