Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
fix(gridlist): noops layoutDelegate
Browse files Browse the repository at this point in the history
Fixes #2613.
  • Loading branch information
ThomasBurleson committed Apr 30, 2015
1 parent 92ed465 commit 2b6dd4d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/gridList/gridList.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {

var invalidateLayout = angular.bind(ctrl, ctrl.invalidateLayout),
unwatchAttrs = watchMedia();
scope.$on('$destroy', unwatchMedia);
scope.$on('$destroy', unwatchMedia);

/**
* Watches for changes in media, invalidating layout as necessary.
Expand All @@ -128,6 +128,8 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {
}

function unwatchMedia() {
ctrl.layoutDelegate = angular.noop;

unwatchAttrs();
for (var mediaName in $mdConstant.MEDIA) {
$mdMedia.getQuery($mdConstant.MEDIA[mediaName])
Expand Down

0 comments on commit 2b6dd4d

Please sign in to comment.