Skip to content

Commit

Permalink
Merge branch '5im0n-fix-exposeAsideWhen'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Jan 8, 2016
2 parents 8404edb + 8c1887b commit 464c27c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions js/angular/directive/exposeAsideWhen.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ IonicModule.directive('exposeAsideWhen', ['$window', function($window) {
require: '^ionSideMenus',
link: function($scope, $element, $attr, sideMenuCtrl) {

// Setup a match media query listener that triggers a ui change only when a change
// in media matching status occurs
var mq = $attr.exposeAsideWhen == 'large' ? '(min-width:768px)' : $attr.exposeAsideWhen;
var mql = $window.matchMedia(mq);
mql.addListener(function() {
var prevInnerWidth = $window.innerWidth;
var prevInnerHeight = $window.innerHeight;

ionic.on('resize', function() {
if (prevInnerWidth === $window.innerWidth && prevInnerHeight === $window.innerHeight) {
return;
}
prevInnerWidth = $window.innerWidth;
prevInnerHeight = $window.innerHeight;
onResize();
});
}, $window);

function checkAsideExpose() {
var mq = $attr.exposeAsideWhen == 'large' ? '(min-width:768px)' : $attr.exposeAsideWhen;
Expand Down

0 comments on commit 464c27c

Please sign in to comment.