Permalink
Browse files

bug: matchMedia.addListener crashed FF + Safari

  • Loading branch information...
MikeMitterer committed Jul 3, 2015
1 parent afa482c commit 5cf55391dc1942a8a97168203fea597dcc59a6e1
@@ -113,9 +113,9 @@
<div class="mdl-accordion">
<label class="mdl-accordion__label">Samples<i class="material-icons indicator">chevron_right</i></label>
<div class="mdl-accordion--content">
<a class="mdl-navigation__link mdl-color-text--primary" href="#/samples">All samples</a>
<a class="mdl-navigation__link mdl-color-text--primary" href="#/todo">ToDo</a>
<a class="mdl-navigation__link mdl-color-text--primary" href="#/dnd">Drag & Drop</a>
<a class="mdl-navigation__link mdl-color-text--primary" href="#/samples">All samples</a>
</div>
</div>
@@ -121,9 +121,9 @@
<div class="mdl-accordion">
<label class="mdl-accordion__label">Samples<i class="material-icons indicator">chevron_right</i></label>
<div class="mdl-accordion--content">
<a class="mdl-navigation__link mdl-color-text--primary" href="#/samples">All samples</a>
<a class="mdl-navigation__link mdl-color-text--primary" href="#/todo">ToDo</a>
<a class="mdl-navigation__link mdl-color-text--primary" href="#/dnd">Drag & Drop</a>
<a class="mdl-navigation__link mdl-color-text--primary" href="#/samples">All samples</a>
</div>
</div>
<!-- Panel 7 -->
@@ -189,7 +189,7 @@ class MaterialLayout extends MdlComponent {
// Keep an eye on screen size, and add/remove auxiliary class for styling
// of small screens.
_screenSizeMediaQuery = dom.window.matchMedia(_constant.MAX_WIDTH);
_screenSizeMediaQuery.onChange.listen(_screenSizeHandler);
_screenSizeMediaQuery.addListener( (_) => _screenSizeHandler());
_screenSizeHandler();
if (header != null) {
@@ -373,8 +373,8 @@ class MaterialLayout extends MdlComponent {
}
/// Handles changes in screen size.
void _screenSizeHandler([final dom.Event event]) {
void _screenSizeHandler() {
_logger.info("ScreenSite changed!");
if (_screenSizeMediaQuery.matches) {
element.classes.add(_cssClasses.IS_SMALL_SCREEN);
}

0 comments on commit 5cf5539

Please sign in to comment.