1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-01-18 03:22:02 +02:00

Fixed use of unquoted scroll options (#521)

This commit is contained in:
Tim Voronov 2020-05-27 17:34:06 -04:00 committed by GitHub
parent d7cd7581a4
commit bddf1779be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package templates
import (
"fmt"
"github.com/MontFerret/ferret/pkg/drivers"
)
@ -23,9 +24,9 @@ const (
window.scrollTo({
left: %s,
top: %s,
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
`
@ -33,9 +34,9 @@ const (
window.scrollTo({
left: 0,
top: 0,
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
`
@ -43,22 +44,21 @@ const (
window.scrollTo({
left: 0,
top: window.document.body.scrollHeight,
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
`
scrollIntoViewTemplate = `
(el) => {
` + isElementInViewportTemplate + `
if (!isInViewport(el)) {
el.scrollIntoView({
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
}
@ -77,9 +77,9 @@ const (
if (!isInViewport(el)) {
el.scrollIntoView({
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
}