Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

slide to open/close option #8

Open
ghost opened this issue Jan 25, 2015 · 5 comments
Open

slide to open/close option #8

ghost opened this issue Jan 25, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 25, 2015

Hi,

I tested Ionic Drawer and it works like a charm. I noticed that it doesn't have slide/pull to open and close option. Is there some way to add this feature?

Thanks in advance!!

@gylippus
Copy link

Have you tried sliding you finger from the very far left of the screen? This is the more common interaction for Android as opposed to the whole screen enabling the side menu in iOS.

@imsingh
Copy link

imsingh commented Jan 25, 2015

Yeah. Dragging works with demo. Try to drag from start of screen. Actually
I was confused with terminology. I think this answers your question.

Thanks.
On Jan 25, 2015 5:28 PM, "gylippus" [email protected] wrote:

Have you tried sliding you finger from the very far left of the screen?
This is the more common interaction for Android as opposed to the whole
screen enabling the side menu in iOS.


Reply to this email directly or view it on GitHub
#8 (comment)
.

@aerotoad
Copy link

aerotoad commented Feb 9, 2015

Same problem here, in browser it works well, but in android device, the drag gesture does not open the drawer.

@harishkotra
Copy link

@aerotoad I understand your issue. This is a very weird decision on swiping from the corner. Following is a snippet I use for a workaround

var dragCount = 0;
var element = angular.element(document.querySelector('#eventPlaceholder'));
        var events = [{
        event: 'dragup',
        text: 'You dragged me UP!'
        },{
        event: 'dragdown',
        text: 'You dragged me Down!'
        },{
        event: 'dragleft',
        text: 'You dragged me Left!'
        },{
        event: 'dragright',
        text: 'You dragged me Right!'
        }];
angular.forEach(events, function(obj){
var dragGesture = $ionicGesture.on(obj.event, function (event) {
    $rootScope.$apply(function () {
        $rootScope.lastEventCalled = obj.text;
        if (obj.event == 'dragleft'){                           
            if (dragCount == 2){
              $rootScope.closeDrawer();
            }
            dragCount++;
            if (dragCount > 10){
              dragCount = 0;
            }
        }
        if (obj.event == 'dragright'){                          
            if (dragCount == 2){
              $rootScope.openDrawer();
            }
            dragCount++;
            if (dragCount > 10){
              dragCount = 0;
            }
        }
    });

    }, element);
}); 

@prasadyallapu
Copy link

I am using ionic drawer in ipad it was working fine,but in browser the side menu is displaying by default.Can some one help me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants