com web/php: Fix # scroll (FU docbook): js/common.js styles/theme-base.css
| From: | Dejan Marjanovic | Date: | Sat, 23 Nov 2013 04:32:03 +0000 |
| Subject: | com web/php: Fix # scroll (FU docbook): js/common.js styles/theme-base.css | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-17220@lists.php.net to get a copy of this message | ||
Commit: 4b24c64d665bdcdb900ff11d38cf276fdf592986
Author: Dejan Marjanovic <dejan.marjanovic@gmail.com> Sat, 23 Nov 2013 05:32:03
+0100
Parents: f0a599b5d062e782469e8bbde2dbf2f8db835dc4
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=4b24c64d665bdcdb900ff11d38cf276fdf592986
Log:
Fix # scroll (FU docbook)
Changed paths:
M js/common.js
M styles/theme-base.css
Diff:
diff --git a/js/common.js b/js/common.js
index dac7951..9195570 100755
--- a/js/common.js
+++ b/js/common.js
@@ -1,5 +1,10 @@
/* Plugins, etc, are on top. */
+String.prototype.escapeSelector = function()
+{
+ return this.replace(/(.|#)([ #;&,.+*~\':"!^$\[\]\(\)=>|\/])/g, '$1' +
'\\\\$2');
+}
+
/** {{{
* jQuery.ScrollTo - Easy element scrolling using jQuery.
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
@@ -220,17 +225,22 @@ $(document).ready(function() {
var jHtmlBody = $('html, body');
function scroll(target, interval)
{
- if ( ! interval && interval !== 0)
+ if ( ! interval)
interval = 400;
+
+ target = $('[id="' + target.substring(1) + '"]');
+ var top = 52;
+
jHtmlBody.animate({
- scrollTop: $(target).offset().top - 52
+ scrollTop: target.offset().top - top
}, interval);
- return false;
+
+ return true;
}
if (window.location.hash)
- scroll(window.location.hash, 0)
+ scroll(window.location.hash, 1)
$('a[href^=#]').click(function(e){
e.preventDefault();
diff --git a/styles/theme-base.css b/styles/theme-base.css
index 3b4f08d..de65b8f 100755
--- a/styles/theme-base.css
+++ b/styles/theme-base.css
@@ -2333,12 +2333,14 @@ pre.info {
/*#layout .refsect1[id]:before,*/
+/**
#layout *[id]:target:before {
display:block;
content:" ";
margin-top:-56px;
height:56px;
}
+*/
#search-results {
margin:10px 40px;