Fix widths for media queries in JavaScript

This commit is contained in:
squidfunk 2017-01-07 18:02:21 +01:00
parent d53945a89a
commit ebff8b795b
4 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@
<script src="https://cdn.mathjax.org/{{ path }}"></script> <script src="https://cdn.mathjax.org/{{ path }}"></script>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<script src="{{ base_url }}/assets/javascripts/application-c6a54b6fec.js"></script> <script src="{{ base_url }}/assets/javascripts/application-ca9b3745c3.js"></script>
<script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script> <script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script>
{% for path in extra_javascript %} {% for path in extra_javascript %}
<script src="{{ path }}"></script> <script src="{{ path }}"></script>

View File

@ -101,7 +101,7 @@ export default class Application {
], new Material.Sidebar.Container("[data-md-component=container]"))) ], new Material.Sidebar.Container("[data-md-component=container]")))
/* Component: sidebar with navigation */ /* Component: sidebar with navigation */
new Material.Event.MatchMedia("(min-width: 1200px)", new Material.Event.MatchMedia("(min-width: 1220px)",
new Material.Event.Listener(window, [ new Material.Event.Listener(window, [
"scroll", "resize", "orientationchange" "scroll", "resize", "orientationchange"
], new Material.Sidebar.Position("[data-md-component=navigation]"))) ], new Material.Sidebar.Position("[data-md-component=navigation]")))
@ -121,13 +121,13 @@ export default class Application {
const collapsibles = const collapsibles =
document.querySelectorAll("[data-md-component=collapsible]") document.querySelectorAll("[data-md-component=collapsible]")
Array.prototype.forEach.call(collapsibles, collapse => { Array.prototype.forEach.call(collapsibles, collapse => {
new Material.Event.MatchMedia("(min-width: 1200px)", new Material.Event.MatchMedia("(min-width: 1220px)",
new Material.Event.Listener(collapse.previousElementSibling, "click", new Material.Event.Listener(collapse.previousElementSibling, "click",
new Material.Nav.Collapse(collapse))) new Material.Nav.Collapse(collapse)))
}) })
/* Component: pane monitor for iOS scrolling fixes */ /* Component: pane monitor for iOS scrolling fixes */
new Material.Event.MatchMedia("(max-width: 1199px)", new Material.Event.MatchMedia("(max-width: 1219px)",
new Material.Event.Listener( new Material.Event.Listener(
"[data-md-component=navigation] [data-md-toggle]", "change", "[data-md-component=navigation] [data-md-toggle]", "change",
new Material.Nav.Scrolling("[data-md-component=navigation] nav"))) new Material.Nav.Scrolling("[data-md-component=navigation] nav")))
@ -153,7 +153,7 @@ export default class Application {
})).listen() })).listen()
/* Listener: prevent touches on overlay if navigation is active */ /* Listener: prevent touches on overlay if navigation is active */
new Material.Event.MatchMedia("(max-width: 1199px)", new Material.Event.MatchMedia("(max-width: 1219px)",
new Material.Event.Listener("[data-md-component=overlay]", "touchstart", new Material.Event.Listener("[data-md-component=overlay]", "touchstart",
ev => ev.preventDefault())) ev => ev.preventDefault()))

View File

@ -35,10 +35,10 @@
/// ), /// ),
/// tablet: ( /// tablet: (
/// portrait: 720px 959px, /// portrait: 720px 959px,
/// landscape: 960px 1199px /// landscape: 960px 1219px
/// ), /// ),
/// screen: ( /// screen: (
/// small: 1200px 1599px, /// small: 1220px 1599px,
/// medium: 1600px 1999px, /// medium: 1600px 1999px,
/// large: 2000px /// large: 2000px
/// ) /// )