[ 
https://issues.apache.org/jira/browse/CB-10744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15174761#comment-15174761
 ] 

ASF GitHub Bot commented on CB-10744:
-------------------------------------

Github user rakatyal commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/526#discussion_r54665031
  
    --- Diff: www/static/js/index.js ---
    @@ -145,17 +145,48 @@ $(document).ready(function () {
     
         // Smooth scroll to anchor links
         $("a[href^='#']").on('click', function(e) {
    -        if(this.hash) {
    +
    +        // scroll only if there is a hash in the href
    +        var hash = this.hash;
    +        if (hash) {
     
                 // prevent default anchor click behavior
                 e.preventDefault();
     
    -            // store hash
    -            var hash = this.hash;
    +            // get the fragment without the "#" symbol
    +            var targetName = hash;
    +            if (targetName[0] === "#") {
    --- End diff --
    
    Do we need to return if this condition fails?


> Fragment links in docs don't work in many cases
> -----------------------------------------------
>
>                 Key: CB-10744
>                 URL: https://issues.apache.org/jira/browse/CB-10744
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Docs
>            Reporter: Dmitry Blotsky
>            Assignee: Dmitry Blotsky
>            Priority: Minor
>
> Cases that don't work:
> - using {{name="X"}} for fragment anchors
> - using special characters in IDs



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to