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

    https://github.com/apache/cordova-docs/pull/526#discussion_r54666977
  
    --- 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] === "#") {
    +                var targetName = targetName.slice(1);
    --- End diff --
    
    We should not re-define targetName with a `var`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to