Skip to content

Commit

Permalink
Modal Dialog Example: Fix Scrolling (pull #337)
Browse files Browse the repository at this point in the history
For issue #321, fix issue where underlying page scrolls when dialog scrolls.

1. Move dialog divs to div outside of main container.
2. Only scroll the dialog layer when a dialog is open.
  • Loading branch information
tatermelon authored and mcking65 committed Mar 20, 2017
1 parent ce02202 commit b90d2de
Show file tree
Hide file tree
Showing 2 changed files with 336 additions and 296 deletions.
43 changes: 43 additions & 0 deletions examples/dialog-modal/css/dialog.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
body {
max-width: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}

body:not(.toc-inline) {
padding: 0;
}

#base_window_layer {
box-sizing: border-box;
height: 100vh;
width: 100%;
overflow: auto;
padding: 1.6em 0 2em;
}

#base_window_layer main, #base_window_layer nav {
max-width: 50em;
margin: auto;
padding-right: 1.5em;
padding-left: 50px;
padding-left: calc(26px + 1.5em);
}

@media screen and (min-width: 78em) {
body:not(.toc-inline) #base_window_layer main, body:not(.toc-inline) #base_window_layer nav {
padding-left: 29em;
}

body:not(.toc-inline) {
padding: 0;
}
}

body:not(.toc-inline) #main_content main, body:not(.toc-inline) #main_content nav {
padding-left: 1.5em;
}


.hidden {
display: none
}
Expand All @@ -9,6 +51,7 @@
top: 0;
left: 0;
overflow: auto;
background: rgba(0, 0, 0, 0.3);
}

div.default_dialog {
Expand Down
Loading

0 comments on commit b90d2de

Please sign in to comment.