mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
not terrible autoscrolling in add card window
This commit is contained in:
parent
51146ccd51
commit
8c424e5e95
1 changed files with 5 additions and 1 deletions
|
@ -97,7 +97,11 @@ function onFocus(elem) {
|
||||||
} while (obj = obj.offsetParent);
|
} while (obj = obj.offsetParent);
|
||||||
return cur;
|
return cur;
|
||||||
}
|
}
|
||||||
window.scroll(0,pos(elem)-15);
|
var y = pos(elem);
|
||||||
|
if ((window.pageYOffset+window.innerHeight) < (y+elem.offsetHeight))
|
||||||
|
window.scroll(0,y+elem.offsetHeight-window.innerHeight);
|
||||||
|
else if (window.pageYOffset > y)
|
||||||
|
window.scroll(0, y-15);
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore cursor
|
// restore cursor
|
||||||
|
|
Loading…
Reference in a new issue