Commit c73c3d20 by Matjaz Gregoric

Use fixed positioning for mobile popups.

Fixed positioning allows us to maximize the usage of screen space and
fixes some issues with popups containing a lot of content and
overflowing the DnD container.
parent 621c7ba2
...@@ -430,7 +430,6 @@ ...@@ -430,7 +430,6 @@
.xblock--drag-and-drop .popup { .xblock--drag-and-drop .popup {
position: absolute; position: absolute;
display: none;
top: 5%; top: 5%;
right: 5%; right: 5%;
border: 1px solid #fff; border: 1px solid #fff;
...@@ -503,12 +502,19 @@ ...@@ -503,12 +502,19 @@
} }
.xblock--drag-and-drop .popup { .xblock--drag-and-drop .popup {
display: flex;
flex-direction: column;
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
text-align: center; text-align: center;
box-shadow: 0 0 100px rgba(0,0,0,0.4); box-shadow: 0 0 100px rgba(0,0,0,0.4);
border: none; border: none;
max-height: 90vh; max-height: 90vh;
position: fixed;
top: 50%;
left: 50%;
right: auto;
transform: translate(-50%, -50%);
} }
.xblock--drag-and-drop .popup .close-feedback-popup-desktop-button { .xblock--drag-and-drop .popup .close-feedback-popup-desktop-button {
...@@ -545,6 +551,8 @@ ...@@ -545,6 +551,8 @@
border-color: #eee; border-color: #eee;
border-style: solid; border-style: solid;
border-width: 1px 0 1px 0; border-width: 1px 0 1px 0;
flex-shrink: 1;
overflow: auto;
} }
.xblock--drag-and-drop .popup .popup-content ul { .xblock--drag-and-drop .popup .popup-content ul {
......
...@@ -446,10 +446,15 @@ function DragAndDropTemplates(configuration) { ...@@ -446,10 +446,15 @@ function DragAndDropTemplates(configuration) {
); );
} }
var popup_style = {};
if (!have_messages) {
popup_style.display = 'none';
}
return h( return h(
popupSelector, popupSelector,
{ {
style: {display: have_messages ? 'block' : 'none'} style: popup_style
}, },
[ [
h( h(
...@@ -493,13 +498,18 @@ function DragAndDropTemplates(configuration) { ...@@ -493,13 +498,18 @@ function DragAndDropTemplates(configuration) {
), ),
popup_content, popup_content,
h( h(
'button.unbutton.close-feedback-popup-button.close-feedback-popup-mobile-button', 'div',
{},
[ [
h( h(
'span', 'button.unbutton.close-feedback-popup-button.close-feedback-popup-mobile-button',
{}, {},
gettext("Close") [
h(
'span',
{},
gettext("Close")
)
]
) )
] ]
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment