Fossil

Check-in [ad3a8e0b87]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Experimental change to scroll the focused entry into view with a Fossil-style scrolling function to keep the entry centered vertically. This is much better than `Element.scrollIntoView()' for FF (but maybe a matter of tweaking the function arguments). Kudos to the wiz who programmed the `scrollToSelected()' function!
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | timeline-keyboard-navigation
Files: files | file ages | folders
SHA3-256: ad3a8e0b87ea716f416daa0719ad161c151eb02f7403161cc0930fa9df1c5548
User & Date: florian 2022-08-04 06:57:00.000
Context
2022-08-04
11:42
Try to fix the focus indicator CSS to work for all skins: alpha-blending "10% black" with light-mode background colors, or "20% white" with dark-mode background colors, looks surprisingly well and conflicts less with branch colors (which can be orange-ish, but never black or white). Note that the dark-mode skins Ardoise, Dark Mode and Xekri (but not Eagle) require the previously removed !important directive. It\'s still possible for skins to overwrite the focus indicator CSS when duplicating the !important directive. ... (check-in: 7d02688690 user: florian tags: timeline-keyboard-navigation)
06:57
Experimental change to scroll the focused entry into view with a Fossil-style scrolling function to keep the entry centered vertically. This is much better than `Element.scrollIntoView()' for FF (but maybe a matter of tweaking the function arguments). Kudos to the wiz who programmed the `scrollToSelected()' function! ... (check-in: ad3a8e0b87 user: florian tags: timeline-keyboard-navigation)
06:14
Comment and TODO updates. ... (check-in: ec8b53a9bc user: florian tags: timeline-keyboard-navigation)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/graph.js.
903
904
905
906
907
908
909








910
911
912
913
914
915
916
917
918
919
920

921
922
923
924
925
926
927
928
929
          'baseurl': ti.baseUrl,
          'hashdigits': ti.hashDigits,
          'hash': ti.rowinfo[k].h,
          'branch': ti.rowinfo[k].br };
        }
      }
      return null;








    }
    function focusVisualize(id,scroll){
      var td = document.querySelector('.timelineFocused');
      if( td ) td.classList.remove('timelineFocused');
      if( !id ) return true;
      var tn = document.getElementById(id);
      if( tn ){
        td = tn.parentElement.nextElementSibling;
        if( td ) {
          td.classList.add('timelineFocused');
          if( scroll ){

            if( td.scrollIntoViewIfNeeded ) td.scrollIntoViewIfNeeded();
            else td.scrollIntoView(false);
          }
          return true;
        }
      }
      return false;
    }
    function focusCacheInit(){







>
>
>
>
>
>
>
>











>
|
|







903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
          'baseurl': ti.baseUrl,
          'hashdigits': ti.hashDigits,
          'hash': ti.rowinfo[k].h,
          'branch': ti.rowinfo[k].br };
        }
      }
      return null;
    }
    function focusScrollToIntoViewTheFossilWay(e){
      var y = 0;
      do{
        y += e.offsetTop;
      }while( e = e.offsetParent );
      y -= window.innerHeight/2;
      if( y>0 ) window.scrollTo(0,y);
    }
    function focusVisualize(id,scroll){
      var td = document.querySelector('.timelineFocused');
      if( td ) td.classList.remove('timelineFocused');
      if( !id ) return true;
      var tn = document.getElementById(id);
      if( tn ){
        td = tn.parentElement.nextElementSibling;
        if( td ) {
          td.classList.add('timelineFocused');
          if( scroll ){
            focusScrollToIntoViewTheFossilWay(td);
            //if( td.scrollIntoViewIfNeeded ) td.scrollIntoViewIfNeeded();
            //else td.scrollIntoView(false);
          }
          return true;
        }
      }
      return false;
    }
    function focusCacheInit(){