iegorov
10/17/2016 - 7:03 AM

Mobile logic to display and close menu and content.

Mobile logic to display and close menu and content.

vm.menuIsShow = true;
vm.contentIsShow = true;
vm.showMenu = showMenu;
vm.showContent = showContent;

function showMenu() {
  if (!adaptive.mobile()) {
    return;
  }
  vm.menuIsShow = true;
  vm.contentIsShow = false;
}

function showContent() {
  vm.contentIsShow = true;
  vm.menuIsShow = false;
}

$scope.$watch(function() {
  return adaptive.mobile();
}, function(mobile) {
  self.menuIsShow = true;
  if (mobile) {
    self.contentIsShow = false;
  } else {
    self.contentIsShow = true;
  }
});