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
5457f35f
Commit
5457f35f
authored
Jan 18, 2013
by
Valera Rozuvan
Committed by
Alexander Kryklia
Jan 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drag and Drop: Further testing of new feature "can reuse".
parent
7ad6ef21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
common/static/js/capa/drag_and_drop/draggables.js
+5
-1
common/static/js/capa/drag_and_drop/state.js
+25
-1
common/static/js/capa/drag_and_drop/targets.js
+1
-2
No files found.
common/static/js/capa/drag_and_drop/draggables.js
View file @
5457f35f
...
...
@@ -63,6 +63,8 @@ define(['logme', 'update_input'], function (logme, updateInput) {
var
draggableObj
,
obj
;
draggableObj
=
{
'uniqueId'
:
/* this.uniqueId */
this
.
state
.
getUniqueId
(),
// Is newly set.
'originalConfigObj'
:
this
.
originalConfigObj
,
'stateDraggablesIndex'
:
/* this.stateDraggablesIndex */
null
,
// Will be set.
...
...
@@ -379,6 +381,8 @@ define(['logme', 'update_input'], function (logme, updateInput) {
var
draggableObj
;
draggableObj
=
{
'uniqueId'
:
state
.
getUniqueId
(),
'originalConfigObj'
:
obj
,
'stateDraggablesIndex'
:
null
,
...
...
@@ -768,7 +772,7 @@ define(['logme', 'update_input'], function (logme, updateInput) {
if
(
(
this
.
state
.
config
.
onePerTarget
===
true
)
&&
(
target
.
draggableList
.
length
===
1
)
&&
(
target
.
draggableList
[
0
].
id
!==
this
.
i
d
)
(
target
.
draggableList
[
0
].
uniqueId
!==
this
.
uniqueI
d
)
)
{
continue
;
}
...
...
common/static/js/capa/drag_and_drop/state.js
View file @
5457f35f
...
...
@@ -26,9 +26,33 @@ define([], function () {
'targets'
:
[],
'updateArrowOpacity'
:
null
'updateArrowOpacity'
:
null
,
'uniqueId'
:
0
,
'salt'
:
makeSalt
(),
'getUniqueId'
:
getUniqueId
};
}
function
getUniqueId
()
{
this
.
uniqueId
+=
1
;
return
this
.
salt
+
'_'
+
this
.
uniqueId
.
toFixed
(
0
);
}
function
makeSalt
()
{
var
text
,
possible
,
i
;
text
=
''
;
possible
=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
;
for
(
i
=
0
;
i
<
5
;
i
+=
1
)
{
text
+=
possible
.
charAt
(
Math
.
floor
(
Math
.
random
()
*
possible
.
length
));
}
return
text
;
}
});
// End of wrapper for RequireJS. As you can see, we are passing
...
...
common/static/js/capa/drag_and_drop/targets.js
View file @
5457f35f
...
...
@@ -15,7 +15,7 @@ define(['logme'], function (logme) {
c1
+=
1
;
}
}(
0
));
}
// function Targets(state) {
}
function
processTarget
(
state
,
obj
)
{
var
targetEl
,
borderCss
,
numTextEl
,
targetObj
;
...
...
@@ -36,7 +36,6 @@ define(['logme'], function (logme) {
'left: '
+
obj
.
x
+
'px; '
+
borderCss
+
'" '
+
'data-target-id="'
+
obj
.
id
+
'" '
+
'></div>'
);
targetEl
.
appendTo
(
state
.
baseImageEl
.
parent
());
...
...
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