Github user riknoll commented on a diff in the pull request:
https://github.com/apache/cordova-docs/pull/526#discussion_r54826548
--- Diff: www/static/js/index.js ---
@@ -145,17 +145,46 @@ $(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 because
location.hash
+ // is returned with it
+ var targetName = targetName.slice(1);
--- End diff --
This line is a little confusing. Can you make the scoping of `targetName`
clearer by renaming the variable?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]