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
7b02d59b
Commit
7b02d59b
authored
Sep 20, 2017
by
Chandrakant Gopalan
Committed by
Matjaz Gregoric
Sep 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust feedback popup styles for mobile
parent
86e70248
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
150 additions
and
24 deletions
+150
-24
drag_and_drop_v2/public/css/drag_and_drop.css
+105
-17
drag_and_drop_v2/public/js/drag_and_drop.js
+45
-7
No files found.
drag_and_drop_v2/public/css/drag_and_drop.css
View file @
7b02d59b
...
@@ -112,6 +112,19 @@
...
@@ -112,6 +112,19 @@
z-index
:
10
!important
;
z-index
:
10
!important
;
}
}
@media
screen
and
(
max-width
:
480px
)
{
/* Horizontal scroll for item bank on mobile */
.xblock--drag-and-drop
.item-bank
{
-ms-flex-flow
:
row
nowrap
;
flex-flow
:
row
nowrap
;
overflow-x
:
auto
;
}
.xblock--drag-and-drop
.drag-container
.item-bank
.option
{
flex-shrink
:
0
;
}
}
.xblock--drag-and-drop
.drag-container
.option.specified-width
img
{
.xblock--drag-and-drop
.drag-container
.option.specified-width
img
{
width
:
100%
;
/* If the image is smaller than the specified width, make it larger */
width
:
100%
;
/* If the image is smaller than the specified width, make it larger */
}
}
...
@@ -405,7 +418,7 @@
...
@@ -405,7 +418,7 @@
max-width
:
100%
;
max-width
:
100%
;
}
}
.xblock--drag-and-drop
.popup
.close-feedback-popup-button
{
.xblock--drag-and-drop
.popup
.close-feedback-popup-
desktop-
button
{
cursor
:
pointer
;
cursor
:
pointer
;
margin-top
:
8px
;
margin-top
:
8px
;
color
:
#ffffff
;
color
:
#ffffff
;
...
@@ -413,22 +426,110 @@
...
@@ -413,22 +426,110 @@
font-size
:
18pt
;
font-size
:
18pt
;
}
}
.ltr
.xblock--drag-and-drop
.popup
.close-feedback-popup-button
{
.xblock--drag-and-drop
.popup
.close-feedback-popup-mobile-button
{
display
:
none
;
}
.xblock--drag-and-drop
.popup
.popup-header-icon
{
display
:
none
;
}
.xblock--drag-and-drop
.popup
.popup-header-text
{
display
:
none
;
}
.xblock--drag-and-drop
.popup
.popup-header-icon.popup-header-icon-incorrect
{
color
:
#ff143e
;
}
.ltr
.xblock--drag-and-drop
.popup
.close-feedback-popup-desktop-button
{
float
:
right
;
float
:
right
;
margin-right
:
8px
;
margin-right
:
8px
;
margin-left
:
20px
;
margin-left
:
20px
;
}
}
.rtl
.xblock--drag-and-drop
.popup
.close-feedback-popup-button
{
.rtl
.xblock--drag-and-drop
.popup
.close-feedback-popup-
desktop-
button
{
float
:
left
;
float
:
left
;
margin-right
:
20px
;
margin-right
:
20px
;
margin-left
:
8px
;
margin-left
:
8px
;
}
}
.xblock--drag-and-drop
.popup
.close-feedback-popup-button
:focus
{
.xblock--drag-and-drop
.popup
.close-feedback-popup-
desktop-
button
:focus
{
outline
:
2px
dotted
white
;
outline
:
2px
dotted
white
;
}
}
@media
screen
and
(
max-width
:
480px
)
{
.xblock--drag-and-drop
.popup
.popup-content
p
{
text-align
:
center
;
}
.xblock--drag-and-drop
.popup
{
background-color
:
#fff
;
border-radius
:
10px
;
text-align
:
center
;
box-shadow
:
0
0
100px
rgba
(
0
,
0
,
0
,
0.4
);
border
:
none
;
max-height
:
90vh
;
}
.xblock--drag-and-drop
.popup
.close-feedback-popup-desktop-button
{
display
:
none
;
}
.xblock--drag-and-drop
.popup.popup-incorrect
{
background-color
:
#fff
;
}
.xblock--drag-and-drop
.popup
.popup-header-icon
{
display
:
inline-block
;
margin-top
:
10px
;
color
:
#629a2c
;
font-size
:
20pt
;
}
.xblock--drag-and-drop
.popup
.popup-header-icon.popup-header-icon-incorrect
{
color
:
#ff143e
;
}
.xblock--drag-and-drop
.popup
.popup-header-text
{
display
:
block
;
padding
:
2px
0
8px
;
font-weight
:
600
;
}
.xblock--drag-and-drop
.popup
.popup-content
{
color
:
#629a2c
;
margin
:
10px
0px
0px
0px
;
font-size
:
14px
;
background-color
:
#f4ffe7
;
padding
:
20px
;
border-color
:
#eee
;
border-style
:
solid
;
border-width
:
1px
0
1px
0
;
}
.xblock--drag-and-drop
.popup
.popup-content
ul
{
list-style-position
:
inside
;
padding
:
0
;
}
.xblock--drag-and-drop
.popup
.popup-content.popup-content-incorrect
{
color
:
#ff143e
;
background-color
:
#ffe8ec
;
}
.xblock--drag-and-drop
.popup
.close-feedback-popup-mobile-button
{
display
:
inline
;
cursor
:
pointer
;
margin-top
:
10px
;
margin-bottom
:
10px
;
color
:
#3384ca
;
font-size
:
12pt
;
padding
:
10px
;
}
}
/*** edX pattern library components ***/
/*** edX pattern library components ***/
/* reset stock edx-platform button styles */
/* reset stock edx-platform button styles */
...
@@ -586,19 +687,6 @@
...
@@ -586,19 +687,6 @@
}
}
}
}
@media
screen
and
(
max-width
:
480px
)
{
/* Horizontal scroll for item bank on mobile */
.xblock--drag-and-drop
.drag-container
.item-bank
.option
{
flex-shrink
:
0
;
}
.xblock--drag-and-drop
.item-bank
{
-ms-flex-flow
:
row
nowrap
;
flex-flow
:
row
nowrap
;
overflow-x
:
auto
;
}
}
.xblock--drag-and-drop
.sidebar-buttons
.sidebar-button-wrapper
{
.xblock--drag-and-drop
.sidebar-buttons
.sidebar-button-wrapper
{
border-collapse
:
collapse
;
border-collapse
:
collapse
;
padding
:
0
5px
;
padding
:
0
5px
;
...
...
drag_and_drop_v2/public/js/drag_and_drop.js
View file @
7b02d59b
...
@@ -427,11 +427,19 @@ function DragAndDropTemplates(configuration) {
...
@@ -427,11 +427,19 @@ function DragAndDropTemplates(configuration) {
return
h
(
"li"
,
{
innerHTML
:
message
.
message
});
return
h
(
"li"
,
{
innerHTML
:
message
.
message
});
}))
}))
];
];
popup_content
=
h
(
"div.popup-content"
,
{},
have_messages
?
content_items
:
[]);
popup_content
=
h
(
ctx
.
last_action_correct
?
"div.popup-content"
:
"div.popup-content.popup-content-incorrect"
,
{},
have_messages
?
content_items
:
[]
);
}
else
{
}
else
{
popup_content
=
h
(
"div.popup-content"
,
{},
msgs
.
map
(
function
(
message
)
{
popup_content
=
h
(
return
h
(
"p"
,
{
innerHTML
:
message
.
message
});
ctx
.
last_action_correct
?
"div.popup-content"
:
"div.popup-content.popup-content-incorrect"
,
}))
{},
msgs
.
map
(
function
(
message
)
{
return
h
(
"p"
,
{
innerHTML
:
message
.
message
});
})
);
}
}
return
h
(
return
h
(
...
@@ -441,7 +449,7 @@ function DragAndDropTemplates(configuration) {
...
@@ -441,7 +449,7 @@ function DragAndDropTemplates(configuration) {
},
},
[
[
h
(
h
(
'button.unbutton.close-feedback-popup-button'
,
'button.unbutton.close-feedback-popup-button
.close-feedback-popup-desktop-button
'
,
{},
{},
[
[
h
(
h
(
...
@@ -460,7 +468,37 @@ function DragAndDropTemplates(configuration) {
...
@@ -460,7 +468,37 @@ function DragAndDropTemplates(configuration) {
)
)
]
]
),
),
popup_content
h
(
ctx
.
last_action_correct
?
'div.popup-header-icon'
:
'div.popup-header-icon.popup-header-icon-incorrect'
,
{},
[
h
(
ctx
.
last_action_correct
?
'span.icon.fa.fa-check-circle'
:
'span.icon.fa.fa-exclamation-circle'
,
{
attributes
:
{
'aria-hidden'
:
true
}
}
)
]
),
h
(
'div.popup-header-text'
,
{},
ctx
.
last_action_correct
?
gettext
(
"Correct"
)
:
gettext
(
"Incorrect"
)
),
popup_content
,
h
(
'button.unbutton.close-feedback-popup-button.close-feedback-popup-mobile-button'
,
{},
[
h
(
'span'
,
{},
gettext
(
"Close"
)
)
]
)
]
]
)
)
};
};
...
@@ -1092,7 +1130,7 @@ function DragAndDropBlock(runtime, element, configuration) {
...
@@ -1092,7 +1130,7 @@ function DragAndDropBlock(runtime, element, configuration) {
var
focusItemFeedbackPopup
=
function
()
{
var
focusItemFeedbackPopup
=
function
()
{
var
popup
=
$root
.
find
(
'.item-feedback-popup'
);
var
popup
=
$root
.
find
(
'.item-feedback-popup'
);
if
(
popup
.
length
&&
popup
.
is
(
":visible"
))
{
if
(
popup
.
length
&&
popup
.
is
(
":visible"
))
{
popup
.
find
(
'.close-feedback-popup-button'
).
focus
();
popup
.
find
(
'.close-feedback-popup-button
:visible
'
).
focus
();
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
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