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
a4260ba5
Commit
a4260ba5
authored
Aug 08, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR comments: rename events
parent
16a4dfee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
drag_and_drop_v2/drag_and_drop_v2.py
+1
-5
drag_and_drop_v2/public/js/drag_and_drop.js
+13
-9
No files found.
drag_and_drop_v2/drag_and_drop_v2.py
View file @
a4260ba5
...
@@ -97,10 +97,6 @@ class DragAndDropBlock(XBlock):
...
@@ -97,10 +97,6 @@ class DragAndDropBlock(XBlock):
fragment
.
initialize_js
(
'DragAndDropBlock'
)
fragment
.
initialize_js
(
'DragAndDropBlock'
)
self
.
runtime
.
publish
(
self
,
'drag-and-drop-v2.problem.shown'
,
{
'component_id'
:
self
.
scope_ids
.
usage_id
,
'user_id'
:
self
.
runtime
.
user_id
}
)
return
fragment
return
fragment
def
studio_view
(
self
,
context
):
def
studio_view
(
self
,
context
):
...
@@ -191,7 +187,7 @@ class DragAndDropBlock(XBlock):
...
@@ -191,7 +187,7 @@ class DragAndDropBlock(XBlock):
# so we have to figure that we're running in Studio for now
# so we have to figure that we're running in Studio for now
pass
pass
self
.
runtime
.
publish
(
self
,
'drag-and-drop-v2.item.dropped'
,
{
self
.
runtime
.
publish
(
self
,
'
xblock.
drag-and-drop-v2.item.dropped'
,
{
'component_id'
:
self
.
scope_ids
.
usage_id
,
'component_id'
:
self
.
scope_ids
.
usage_id
,
'user_id'
:
self
.
runtime
.
user_id
,
'user_id'
:
self
.
runtime
.
user_id
,
'item_id'
:
item
[
'id'
],
'item_id'
:
item
[
'id'
],
...
...
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
a4260ba5
function
DragAndDropBlock
(
runtime
,
element
)
{
function
DragAndDropBlock
(
runtime
,
element
)
{
function
publish_event
(
data
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'publish_event'
),
data
:
JSON
.
stringify
(
data
)
});
}
var
dragAndDrop
=
(
function
(
$
)
{
var
dragAndDrop
=
(
function
(
$
)
{
var
_fn
=
{
var
_fn
=
{
...
@@ -93,16 +101,8 @@ function DragAndDropBlock(runtime, element) {
...
@@ -93,16 +101,8 @@ function DragAndDropBlock(runtime, element) {
target
=
$
(
event
.
currentTarget
);
target
=
$
(
event
.
currentTarget
);
target
.
removeClass
(
'within-dropzone fade'
);
target
.
removeClass
(
'within-dropzone fade'
);
function
publish_event
(
data
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'publish_event'
),
data
:
JSON
.
stringify
(
data
)
});
}
var
item_id
=
target
.
data
(
"value"
);
var
item_id
=
target
.
data
(
"value"
);
publish_event
({
event_type
:
'
drag-and-drop-v2.item.picked-
up'
,
item_id
:
item_id
});
publish_event
({
event_type
:
'
xblock.drag-and-drop-v2.item.picked
up'
,
item_id
:
item_id
});
},
},
stop
:
function
(
event
,
ui
)
{
stop
:
function
(
event
,
ui
)
{
...
@@ -250,4 +250,8 @@ function DragAndDropBlock(runtime, element) {
...
@@ -250,4 +250,8 @@ function DragAndDropBlock(runtime, element) {
}).
done
(
function
(
data
){
}).
done
(
function
(
data
){
dragAndDrop
.
init
(
data
);
dragAndDrop
.
init
(
data
);
});
});
publish_event
({
event_type
:
"xblock.drag-and-drop-v2.loaded"
});
}
}
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