Skip to content

Commit

Permalink
Remove full height modal. Add full height for modal forms. Fix the au…
Browse files Browse the repository at this point in the history
…tofocus value
  • Loading branch information
vidya-ram committed Jul 16, 2020
1 parent 16cf6cd commit a9d15ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
11 changes: 7 additions & 4 deletions baseframe/static/css/mui.css
Expand Up @@ -4440,10 +4440,7 @@ li p + ol {
display: inline-block;
overflow: hidden;
padding: 16px;
width: 100%;
min-height: 100%;
max-width: 100%;
border-radius: 0;
border-radius: 8px;
}
.jquery-modal.blocker.current .modal a.close-modal {
display: none;
Expand All @@ -4457,6 +4454,12 @@ li p + ol {
.jquery-modal.blocker.current .modal .modal__body__btn {
margin-top: 16px;
}
.jquery-modal.blocker.current .modal-form {
width: 100%;
border-radius: 0;
overflow: auto;
min-height: 100%;
}

@media (min-width: 768px) {
.jquery-modal.blocker.current {
Expand Down
11 changes: 7 additions & 4 deletions baseframe/static/sass/baseframe-material/_modal.scss
Expand Up @@ -10,10 +10,7 @@
overflow: hidden;
padding: $mui-grid-padding;
@extend .mui--z1;
width: 100%;
min-height: 100%;
max-width: 100%;
border-radius: 0;
border-radius: 8px;

//Use fa5 icon for close
a.close-modal {
Expand All @@ -36,6 +33,12 @@
margin-top: $mui-grid-padding;
}
}
.modal-form {
width: 100%;
border-radius: 0;
overflow: auto;
min-height: 100%;
}
}

@media (min-width: 768px) {
Expand Down
5 changes: 3 additions & 2 deletions baseframe/templates/baseframe/mui/forms.html.jinja2
Expand Up @@ -156,12 +156,13 @@
<input type="hidden" name="form.revision" value="{{ draft_revision if draft_revision is not none }}" />
{%- endif %}
{%- set autofocus = true %}
{% set autofocus = namespace(val=true) %}
{% for field in form -%}
{%- if field.type in ['CSRFTokenField', 'HiddenField', 'NonceField'] -%}
{# Don't show hidden #}
{%- else -%}
{{ renderfield(field, autofocus=autofocus, style=style) }}
{%- if autofocus %}{% set autofocus = false %}{% endif %}
{{ renderfield(field, autofocus=autofocus.val, style=style) }}
{%- if autofocus.val %}{% set autofocus.val = false %}{% endif %}
{%- endif %}
{% endfor %}
{%- endmacro %}
Expand Down

0 comments on commit a9d15ee

Please sign in to comment.