Stop Side Menu Right Drag to Close


#1

Hi, in my app I have a side-menu on the right.
$ionicSideMenuDelegate.canDragContent (false); inserted.
and when the side-menu is not open yet leaves no drag.
Until then everything right.
But the problem comes when the side-menu is open,
do not know why but if you let me drag it to close and do not want this.
Is there a solution?
Thank you.


#2

I dabbled with it a few different ways. Using the drag-content option, the same problem occurs. You can preventing dragging to OPEN, but you can’t prevent dragging to CLOSE.

I’d suggest you open a bug or feature request. http://ionicframework.com/submit-issue/


#3

Thanks Calendee,
I found out the line that does it for if someone helps,
self.isOpen is commented

ionic.bundle.js
line 40368

return ($scope.dragContent /*|| self.isOpen()*/) &&
           dragIsWithinBounds &&
           !e.gesture.srcEvent.defaultPrevented &&
           !e.target.tagName.match(/input|textarea|select|object|embed/i) &&
           !e.target.isContentEditable &&
           !(e.target.dataset ? e.target.dataset.preventScroll : e.target.getAttribute('data-prevent-scroll') == 'true');

#4

I’d still open a feature request. Might be useful to not allow drag to close.


#5

Thank you,
a question that I would solve this.
Could you detect when SIDEMENU close?


#6

Yep.

http://ionicframework.com/docs/nightly/api/service/$ionicSideMenuDelegate/

Use the isOpen() method.