I am working in an app that require snap menu for mobile resolutions and mobile device.
I am using snapjs and angular-snap, snapjs by default set two drawers, left and right, I can disable one of this drawers using the service in the angular-snap directive with snapRemote.globalOptions.disable = 'right'; or using attribute snap-opt-disable="'right'" in snap-content element.
I need to disable all drawers in non mobile resolutions (>= 768px), actualy I have a directive that check this resolutions, but I don't know how disable both drawers, left and right instead only one drawer.
This is my directive:
angular.module('myApp').directive('mobileScreenSwitcher', function ($window, snapRemote) {
return {
restrict: 'E',
link: function (scope) {
$window.onresize = function () {
checkResolution();
};
checkResolution();
function checkResolution() {
var screenWidth = $window.innerWidth;
if (screenWidth >= 768) {
// I need disable all drawers at this line
snapRemote.globalOptions.disable = 'left';
}
}
}
}
});
This is my actual html code
<div ui-view="navBar" snap-drawer="left" ></div>
<div snap-content snap-opt-disable="'right'">
... content here
</div>
<div ui-view="navBar2" snap-drawer="right" ></div>