diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js index 9af80676d5e..a9180663405 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1612,12 +1612,47 @@ function initCore() { snapper.close(); }); + var navigationBarSlideGestureEnabled = false; + var navigationBarSlideGestureAllowed = true; + var navigationBarSlideGestureEnablePending = false; + + OC.allowNavigationBarSlideGesture = function() { + navigationBarSlideGestureAllowed = true; + + if (navigationBarSlideGestureEnablePending) { + snapper.enable(); + + navigationBarSlideGestureEnabled = true; + navigationBarSlideGestureEnablePending = false; + } + }; + + OC.disallowNavigationBarSlideGesture = function() { + navigationBarSlideGestureAllowed = false; + + if (navigationBarSlideGestureEnabled) { + var endCurrentDrag = true; + snapper.disable(endCurrentDrag); + + navigationBarSlideGestureEnabled = false; + navigationBarSlideGestureEnablePending = true; + } + }; + var toggleSnapperOnSize = function() { if($(window).width() > 768) { snapper.close(); snapper.disable(); - } else { + + navigationBarSlideGestureEnabled = false; + navigationBarSlideGestureEnablePending = false; + } else if (navigationBarSlideGestureAllowed) { snapper.enable(); + + navigationBarSlideGestureEnabled = true; + navigationBarSlideGestureEnablePending = false; + } else { + navigationBarSlideGestureEnablePending = true; } }; |