1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-07-13 01:20:35 +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

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,9 +44,9 @@ 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'
}); });
` `
@ -53,12 +54,11 @@ const (
(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'
}); });
} }