mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-27 18:33:39 +01:00
* eMail/Compose: make address suggestion selectbox scrollable
This commit is contained in:
parent
4bcdcfbbe5
commit
d87919fc66
@ -420,6 +420,20 @@ function stopCapturingEvents() {
|
|||||||
hideResultBox();
|
hideResultBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function scrollIntoPosition(pos)
|
||||||
|
{
|
||||||
|
if (typeof pos =='undefined') pos =0;
|
||||||
|
if (pos>0) pos = pos -1;
|
||||||
|
var resultBox = document.getElementById('resultBox');
|
||||||
|
if (typeof resultBox.childNodes[pos] == 'undefined') return;
|
||||||
|
if (typeof(resultBox.childNodes[pos].scrollIntoViewIfNeeded)=='function')
|
||||||
|
{
|
||||||
|
resultBox.childNodes[selectedSuggestion].scrollIntoViewIfNeeded(true);
|
||||||
|
} else {
|
||||||
|
resultBox.childNodes[pos].scrollIntoView(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function keypressed(keycode, keyvalue) {
|
function keypressed(keycode, keyvalue) {
|
||||||
if(liveSearchTimer) {
|
if(liveSearchTimer) {
|
||||||
window.clearTimeout(liveSearchTimer);
|
window.clearTimeout(liveSearchTimer);
|
||||||
@ -432,8 +446,10 @@ function keypressed(keycode, keyvalue) {
|
|||||||
case KEYCODE_UP:
|
case KEYCODE_UP:
|
||||||
if(selectedSuggestion > 0) {
|
if(selectedSuggestion > 0) {
|
||||||
selectSuggestion(selectedSuggestion-1);
|
selectSuggestion(selectedSuggestion-1);
|
||||||
|
scrollIntoPosition(selectedSuggestion-1);
|
||||||
} else {
|
} else {
|
||||||
selectSuggestion(resultRows.length-1);
|
selectSuggestion(resultRows.length-1);
|
||||||
|
scrollIntoPosition(resultRows.length-1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -445,8 +461,10 @@ function keypressed(keycode, keyvalue) {
|
|||||||
//document.title='is selected';
|
//document.title='is selected';
|
||||||
if(selectedSuggestion < resultRows.length-1) {
|
if(selectedSuggestion < resultRows.length-1) {
|
||||||
selectSuggestion(selectedSuggestion+1);
|
selectSuggestion(selectedSuggestion+1);
|
||||||
|
scrollIntoPosition(selectedSuggestion+1);
|
||||||
} else {
|
} else {
|
||||||
selectSuggestion(0);
|
selectSuggestion(0);
|
||||||
|
scrollIntoPosition(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user