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
ccdd61a5
Commit
ccdd61a5
authored
Aug 25, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13 from dragonfi/close-feedback-popup
Make popup close on click to anywhere else.
parents
4085f3ee
05b675bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
drag_and_drop_v2/public/js/drag_and_drop.js
+13
-1
No files found.
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
ccdd61a5
...
...
@@ -102,7 +102,7 @@ function DragAndDropBlock(runtime, element) {
$dropzone
.
on
(
'drop'
,
clk
.
drop
.
success
);
$dropzone
.
on
(
'dropover'
,
clk
.
drop
.
hover
);
$
(
".close"
,
_fn
.
$popup
).
on
(
'click'
,
clk
.
popup
.
close
);
$
(
document
).
on
(
'click'
,
clk
.
popup
.
close
);
_fn
.
$reset_button
.
on
(
'click'
,
clk
.
problem
.
reset
);
},
problem
:
{
...
...
@@ -117,6 +117,16 @@ function DragAndDropBlock(runtime, element) {
},
popup
:
{
close
:
function
(
event
,
ui
)
{
target
=
$
(
event
.
target
);
popup_box
=
".xblock--drag-and-drop .popup"
;
close_button
=
".xblock--drag-and-drop .popup .close"
;
if
(
target
.
is
(
popup_box
))
{
return
;
};
if
(
target
.
parents
(
popup_box
).
length
>
0
&&
!
target
.
is
(
close_button
))
{
return
;
};
_fn
.
$popup
.
hide
();
publish_event
({
event_type
:
'xblock.drag-and-drop-v2.feedback.closed'
,
...
...
@@ -127,6 +137,8 @@ function DragAndDropBlock(runtime, element) {
},
drag
:
{
start
:
function
(
event
,
ui
)
{
_fn
.
clickHandlers
.
popup
.
close
(
event
,
ui
);
target
=
$
(
event
.
currentTarget
);
target
.
removeClass
(
'within-dropzone fade'
);
...
...
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