Example #1
0
 document.addEventListener('backbutton', function() {
   if (UI.isDisabled()) return;
   var main = View.getMain();
   var stack = main.getStack();
   var stackLength = stack && stack.getLength();
   navigate(function() {
     if (stackLength <= 1) navigator.app.exitApp();
     else main.pop();
   });
 }, false);
Example #2
0
    main.addEventListener('touchmove', function(event) {
      if (!isSwipe) return;

      if (UI.isDisabled() || UI.gesturesAreDisabled()) {
        isSwipe = false;
        return;
      }

      event.preventDefault();
      if (Math.abs(event.touches[0].clientY - startY) > 20) {
        isSwipe = false;
        return;
      }

      var offset = event.touches[0].clientX;
      var width = document.body.offsetWidth;
      if (offset / width > 0.15) {
        isSwipe = false;
        navigate(function() {
          View.getMain().pop();
        });
      }
    }, false);
Example #3
0
 main.addEventListener('touchstart', function(event) {
   if (UI.isDisabled() || UI.gesturesAreDisabled()) return;
   if (event.touches[0].clientX <= 25) isSwipe = true;
   startY = event.touches[0].clientY;
 }, false);