Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double tapping a link for an external page breaks the app (custom fix inside) #525

Open
tegola opened this issue Mar 27, 2015 · 0 comments

Comments

@tegola
Copy link

tegola commented Mar 27, 2015

jQTouch already stops taps when animating from one page to another, but it doesn't when tapping an element that triggers an ajax page load, so tapping such element twice results in broken element bindings and ugly animations.

To fix this, read below, but first apply the fix for #524.

Fix

// jqt.js
{
  name: "external",
  isSupported: function(e, params) {
    return true;
  },
  fn: function(e, params) {
    var animation;
    animation = getAnimation(params.$el);
    $body.addClass("external-loading"); // FIX
    params.$el.addClass("loading active");
    showPageByHref(params.$el.attr("href"), {
      animation: animation,
      callback: function() {
        $body.removeClass("external-loading"); // FIX
        params.$el.removeClass("loading");
        return setTimeout(function() {
          return params.$el.removeClass('active');
        }, 250);
      },
      $referrer: params.$el
    });
    return false;
  }
}
// _core.scss - inside the #jqt selector

// Make sure nothing is tappable when loading external pages
&.external-loading:after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant