Fossil SCM

The smart "scroll to" routine also needs to scroll upwards when used for their new purpose.

florian 2022-08-04 12:01 timeline-keyboard-navigation
Commit fff09df34ff57b8d0c95c6b3910646adde05376d23e3537de0217257692e2fd2
1 file changed +1 -2
+1 -2
--- src/graph.js
+++ src/graph.js
@@ -911,12 +911,11 @@
911911
function focusScrollToIntoViewTheFossilWay(e){
912912
var y = 0;
913913
do{
914914
y += e.offsetTop;
915915
}while( e = e.offsetParent );
916
- y -= window.innerHeight/2;
917
- if( y>0 ) window.scrollTo(0,y);
916
+ window.scrollTo(0,y-window.innerHeight/2);
918917
}
919918
function focusVisualize(id,scroll){
920919
var td = document.querySelector('.timelineFocused');
921920
if( td ) td.classList.remove('timelineFocused');
922921
if( !id ) return true;
923922
--- src/graph.js
+++ src/graph.js
@@ -911,12 +911,11 @@
911 function focusScrollToIntoViewTheFossilWay(e){
912 var y = 0;
913 do{
914 y += e.offsetTop;
915 }while( e = e.offsetParent );
916 y -= window.innerHeight/2;
917 if( y>0 ) window.scrollTo(0,y);
918 }
919 function focusVisualize(id,scroll){
920 var td = document.querySelector('.timelineFocused');
921 if( td ) td.classList.remove('timelineFocused');
922 if( !id ) return true;
923
--- src/graph.js
+++ src/graph.js
@@ -911,12 +911,11 @@
911 function focusScrollToIntoViewTheFossilWay(e){
912 var y = 0;
913 do{
914 y += e.offsetTop;
915 }while( e = e.offsetParent );
916 window.scrollTo(0,y-window.innerHeight/2);
 
917 }
918 function focusVisualize(id,scroll){
919 var td = document.querySelector('.timelineFocused');
920 if( td ) td.classList.remove('timelineFocused');
921 if( !id ) return true;
922

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button