Allow for external links in the menu#9
Allow for external links in the menu#9sebastien-fauvel wants to merge 1 commit intorabmyself:masterfrom
Conversation
- To avoid a jQuery exception on matchingSection = $("."+id)
|
@rabmyself I think it should be a possible use case that some of the menu entries (say, the last one) are actually external links. You get a jQuery exception So I'm just filtering out menu links without an And what about the demo page? Would you like to update the script (and its minified version) in this place, too? |
|
I understand what you're trying todo and why. but making smint completely reliant on ids is not a great idea (ruins progressive enhancement). We should be able to use an anchor hash instead of an id. Infact this should be the promoted method. Perhaps it would be better to add logic which tests to see if a DOM object can be found and if not then disregard the link? |
|
You mean the goal should be to set: var matchingSection = $('a[name="'+hash+'"]')whenever possible, only consider the |
|
If I understand you correctly. I was thinking earlier at the point of initialization. This is for example only - so only adding found to the $smintItem list if their href contains an anchor (hash) or the has an id... Even better would be to explicitly check if a DOM element actually exists before adding them to the $smintItem list. Therefore reducing the chance of errors. |
|
I've just seen that there is a class About your proposition:
|
No description provided.