Skip to content
Snippets Groups Projects
Commit 7fe97caa authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fix scrolling on keyboard select in LinkWizard

Ignore-this: 831a3252b5cb7c3f8658c377f60c0a95

darcs-hash:20090814105344-7ad00-6643571c3363ceb25d818246cf1425e3db6c8216.gz
parent 96ed8edc
No related branches found
No related tags found
No related merge requests found
......@@ -119,6 +119,20 @@ linkwiz = {
if(obj){
linkwiz.deselect();
obj.className += ' selected';
// make sure the item is viewable in the scroll view
// FIXME check IE compatibility
if(obj.offsetTop > linkwiz.result.scrollTop + linkwiz.result.clientHeight){
linkwiz.result.scrollTop += obj.clientHeight;
}else if(obj.offsetTop - linkwiz.result.clientHeight < linkwiz.result.scrollTop){ // this works but isn't quite right, fixes welcome
linkwiz.result.scrollTop -= obj.clientHeight;
}
// now recheck - if still not in view, the user used the mouse to scroll
if( (obj.offsetTop > linkwiz.result.scrollTop + linkwiz.result.clientHeight) ||
(obj.offsetTop < linkwiz.result.scrollTop) ){
obj.scrollIntoView();
}
linkwiz.selected = num;
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment