mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge pull request #3048 from danfuzz/fix-first-line-margin-top
Account for any top margin on the first line.
This commit is contained in:
commit
5022912895
1 changed files with 10 additions and 1 deletions
|
@ -5459,7 +5459,16 @@ function Ace2Inner(){
|
||||||
// and the line-numbers don't line up unless we pay
|
// and the line-numbers don't line up unless we pay
|
||||||
// attention to where the divs are actually placed...
|
// attention to where the divs are actually placed...
|
||||||
// (also: padding on TTs/SPANs in IE...)
|
// (also: padding on TTs/SPANs in IE...)
|
||||||
h = b.nextSibling.offsetTop - b.offsetTop;
|
if (b === doc.body.firstChild) {
|
||||||
|
// It's the first line. For line number alignment purposes, its
|
||||||
|
// height is taken to be the top offset of the next line. If we
|
||||||
|
// didn't do this special case, we would miss out on any top margin
|
||||||
|
// included on the first line. The default stylesheet doesn't add
|
||||||
|
// extra margins, but plugins might.
|
||||||
|
h = b.nextSibling.offsetTop;
|
||||||
|
} else {
|
||||||
|
h = b.nextSibling.offsetTop - b.offsetTop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (h)
|
if (h)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue