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

External Links Don't Open #32

Closed
phatsk opened this issue May 29, 2013 · 2 comments
Closed

External Links Don't Open #32

phatsk opened this issue May 29, 2013 · 2 comments

Comments

@phatsk
Copy link

phatsk commented May 29, 2013

If I have links in my sidr menu, such as <a href="/somepage.php">Some Page</a>, sidr appears to be stopping them from opening with a preventDefault - can you add an option honor links?

@phatsk
Copy link
Author

phatsk commented May 29, 2013

Suggesting a patch:

--- sidr.js 2013-05-29 13:01:44.000000000 -0400
+++ sidr.custom.js  2013-05-29 13:02:27.000000000 -0400
@@ -185,7 +185,8 @@
    side          : 'left', // Accepts 'left' or 'right'
    source        : null,   // Override the source of the content.
    renaming      : true,   // The ids and classes will be prepended with a prefix when loading existent content
-      body          : 'body'  // Page container selector,
+      body          : 'body', // Page container selector,
+      honoranchors  : false   // Honor <a> tags
    }, options);

    var name = settings.name,
@@ -250,7 +251,9 @@
    if ( ! data ) {
        $this.data('sidr', name);
        $this.click(function(e) {
-          e.preventDefault();
+          if(!settings.honoranchors) {
+           e.preventDefault();
+         }
        methods.toogle(name);
        });
    }

@artberri
Copy link
Owner

artberri commented Nov 8, 2013

I think you are not using it properly, or maybe I do not understand you. The links works perfectly inside the Sidr, the preventDefault is for the clicking in the button/link that will open the Sidr menu.

@artberri artberri closed this as completed Nov 8, 2013
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

2 participants