in angularjs i am using ngAside. its a plugin for angularjs
based on ui.bootstrap $modal
.
In my code i am using ng-swipe
such as ng-swipe-left
and ng-swipe-right
.
the problem is that on swipe there are multiple sliding menus are opened.
it works well when put with button bt when implemented with swipe gestures
it opens multiple instances. is there anyway i can open only 1 instance for each swipe
HTML
<body ng-app="myApp" ng-controller="globalCtrl" ng-cloak ng-swipe-right="openScrollModal('right')" ng-swipe-left="openScrollModal('left')">
<div ng-include="'menus/navmenu/navmenu.html'" ng-show="showMenu"></div>
<div class="container">
<div class="slide-left" ng-view></div>
</div>
</body>
Controller
app.controller("globalCtrl",function($aside,$scope,$rootScope,$location,$modal)
{
$rootScope.openScrollModal = function(scroll)
{
log(scroll);
log($location.path());
if($rootScope.isAuthenticated)
{
if(scroll=="right")
{
$aside.open({
templateUrl : 'modals/leftSlide/LeftSlide.html',
placement: 'left',
size: 'sm',
show: false
});
}
if(scroll=="left")
{
$aside.open({
templateUrl : 'modals/rightSlide/rightSlide.html',
placement: 'right',
size: 'sm',
show: false
});
}
}
else
{
log("Not Authenticated..Cannot Slide Menu");
}
}
});