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