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
0e723306
Commit
0e723306
authored
Dec 22, 2015
by
E. Kolpakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Overlay-style spinner for items with images
parent
7fb5cfc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
drag_and_drop_v2/public/css/drag_and_drop.css
+16
-0
drag_and_drop_v2/public/js/drag_and_drop.js
+2
-1
drag_and_drop_v2/public/js/view.js
+5
-1
No files found.
drag_and_drop_v2/public/css/drag_and_drop.css
View file @
0e723306
...
...
@@ -85,6 +85,22 @@
float
:
left
;
}
.xblock--drag-and-drop
.drag-container
.option.option-with-image
.spinner-wrapper
{
position
:
absolute
;
float
:
none
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
background-color
:
#000
;
opacity
:
0.6
;
color
:
#fff
;
margin
:
0
;
display
:
flex
;
justify-content
:
center
;
/* align horizontal */
align-items
:
center
;
/* align vertical */
}
.xblock--drag-and-drop
.drag-container
.option
.item-content
{
display
:
inline-block
;
}
...
...
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
0e723306
...
...
@@ -316,7 +316,8 @@ function DragAndDropBlock(runtime, element, configuration) {
class_name
:
item_user_state
&&
(
'input'
in
item_user_state
||
item_user_state
.
correct_input
)
?
'fade'
:
undefined
,
xhr_active
:
(
item_user_state
&&
item_user_state
.
submitting_location
),
input
:
input
,
content_html
:
item
.
backgroundImage
?
'<img src="'
+
item
.
backgroundImage
+
'"/>'
:
item
.
displayName
content_html
:
item
.
backgroundImage
?
'<img src="'
+
item
.
backgroundImage
+
'"/>'
:
item
.
displayName
,
has_image
:
!!
item
.
backgroundImage
};
if
(
item_user_state
)
{
itemProperties
.
is_placed
=
true
;
...
...
drag_and_drop_v2/public/js/view.js
View file @
0e723306
...
...
@@ -54,6 +54,7 @@
var
itemTemplate
=
function
(
item
)
{
var
style
=
{};
var
className
=
(
item
.
class_name
)
?
item
.
class_name
:
""
;
if
(
item
.
background_color
)
{
style
[
'background-color'
]
=
item
.
background_color
;
}
...
...
@@ -64,11 +65,14 @@
style
.
left
=
item
.
x_percent
+
"%"
;
style
.
top
=
item
.
y_percent
+
"%"
;
}
if
(
item
.
has_image
)
{
className
+=
" "
+
"option-with-image"
;
}
return
(
h
(
'div.option'
,
{
key
:
item
.
value
,
className
:
item
.
class_n
ame
,
className
:
classN
ame
,
attributes
:
{
'data-value'
:
item
.
value
,
'data-drag-disabled'
:
item
.
drag_disabled
},
style
:
style
},
[
...
...
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