I've got a function that resizes a viewer on resize. I am trying to disable this on mobile except I'm hitting a wall when In my If Statement. Below is my code.
function desktopResizeOnly() {
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
alert('Mobile');
} else {
$scope.$on('window:resize', function(event, bp) {
viewer.destroy();
update(bp);
});
}
}