You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by db...@apache.org on 2015/08/28 03:00:37 UTC

docs commit: Fixing formatting for some JS.

Repository: cordova-docs
Updated Branches:
  refs/heads/cordova-website fb628f633 -> b9bf9834c


Fixing formatting for some JS.


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/b9bf9834
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/b9bf9834
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/b9bf9834

Branch: refs/heads/cordova-website
Commit: b9bf9834cfbf04573fce2c1ffbff95a89931d16c
Parents: fb628f6
Author: Dmitry Blotsky <dm...@gmail.com>
Authored: Thu Aug 27 18:00:28 2015 -0700
Committer: Dmitry Blotsky <dm...@gmail.com>
Committed: Thu Aug 27 18:00:28 2015 -0700

----------------------------------------------------------------------
 www/static/js/index.js | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/b9bf9834/www/static/js/index.js
----------------------------------------------------------------------
diff --git a/www/static/js/index.js b/www/static/js/index.js
index 5578cfb..4d4f613 100644
--- a/www/static/js/index.js
+++ b/www/static/js/index.js
@@ -130,15 +130,16 @@ $(document).ready(function () {
 
         // store hash
         var hash = this.hash;
+        var LINK_OFFSET = 20; // in pt
 
         // animate
-        $('html, body').animate({
-            scrollTop: $(hash).offset().top
-            }, 300, function(){
-
-            // when done, add hash to url
-            // (default click behaviour)
-            window.location.hash = hash;
-        });
+        $('html, body').animate(
+            {scrollTop: $(hash).offset().top - LINK_OFFSET},
+            300,
+            function () {
+                // when done, add hash to url (default click behaviour)
+                window.location.hash = hash;
+            }
+        );
     });
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org