Skip to content

What is the best way to remove a swipe handler from a page? #359

Description

@ppetree

Most frameworks load pages into the dom and when the user navigates away from that page it's removed from the dom and replaced with the page the user wants and when that happens the swipe hander(s) for the page being discarded are useless and just taking up memory. What's worse is that when the user navigates back to that page, the swipe handlers get set again.

So, what's the best way to remove a swipe handler from a page? Do you @mattbryson check to see if a swipe hander is already in place and overwrite it with the new handler? Do you @mattbryson ignore the second swipe handler? If we set a second swipe handler on an element do you overwrite the first one?

    $("#element").swipe("destroy");

According to the documentation here when you employ the "destroy" method you "Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin."

Destroying the swipe plugin completely is a bit much and also doesn't appear to be true.

I think this needs to be cleared up (especially in the documentation).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions