Last active
June 14, 2018 20:56
-
-
Save 422404/ee92a0f4cf546b9607f12de888baaf14 to your computer and use it in GitHub Desktop.
Revisions
-
422404 revised this gist
Jun 14, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ While digging on how to prevent the user to open the side menu by swiping I found nothing. I tried to override the onEdgeSwipe and onSwipeStart methods of Ext.Viewport but nope... Some tests after, tadaaa ! If I replace the Ext.Viewport.beforeMenuAnimate method with an empty function it prevent the menu opening by swiping... and by calling Ext.Viewport.showMenu(..) ### The solution ```javascript -
422404 created this gist
Jun 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ After digging on how to prevent the user to open the side menu by swiping I found nothing. I tried to override the onEdgeSwipe and onSwipeStart methods of Ext.Viewport but nope... Some tests after, tadaaa ! If I replace the Ext.Viewport.beforeMenuAnimate with an empty function it prevent the menu opening by swiping... and by calling Ext.Viewport.showMenu(..) ### The solution ```javascript let oldBeforeMenuAnimate = null; let noop = function () {}; let viewportPreventEdgeSwipe = function () { oldBeforeMenuAnimate = Ext.Viewport.beforeMenuAnimate; Ext.Viewport.beforeMenuAnimate = noop; } let openMenu = function () { Ext.Viewport.beforeMenuAnimate = oldBeforeMenuAnimate; Ext.Viewport.showMenu('right'); Ext.Viewport.beforeMenuAnimate = noop; } ```