On Sat, Nov 23, 2013 at 5:36 AM, Paul Dragoonis <[email protected]> wrote:

> Hi Dejan,
>
> Could you explain what this fix achieves?
>
>
> On Sat, Nov 23, 2013 at 4:32 AM, Dejan Marjanovic <[email protected]> wrote:
>
>> Commit:    4b24c64d665bdcdb900ff11d38cf276fdf592986
>> Author:    Dejan Marjanovic <[email protected]>         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;
>>
>>
>> --
>> PHP Webmaster List Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

Hi Paul,

It was meant to fix (along with my previous commit) offset issue when page
is scrolled via hash.
Before: http://i.imgur.com/s8CT7Fk.png
After: http://i.imgur.com/aMNbYHm.png

There are few more places that this is fixed as much as possible atm, and
maybe few where I've broken it more so please do tell if that's the case :)
Note that this is "quick & dirty".

Short excerpt from #php.doc

[00:14] <__dm> http://i.imgur.com/s8CT7Fk.png anyone has a idea on a fix
for this?
[00:14] <@bjori> what is the bug?
[00:14] <@bjori> oh right
[00:14] <__dm> navbar is blocking the "return values" heading
[00:15] <__dm> I mean, every #id*
[00:15] <@bjori> __dm: yes.. I had a offset-scrollback script somewhere..
don't know what happened to it
[00:15] <__dm> I "fixed" it with JS
[00:15] <__dm> ah, great
[00:15] <@bjori> do it
[00:15] <@LawnGnome> Yeah, I noticed that when I was working on the
downloads page yesterday. We definitely need some sort of JS to handle that.


-- 
Dejan Marjanovic
Engineer
http://php.net

Reply via email to