Skip to content

Commit

Permalink
Fixed use of unquoted scroll options (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziflex authored May 27, 2020
1 parent d7cd758 commit bddf177
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pkg/drivers/cdp/templates/scroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package templates

import (
"fmt"

"github.com/MontFerret/ferret/pkg/drivers"
)

Expand All @@ -23,42 +24,41 @@ const (
window.scrollTo({
left: %s,
top: %s,
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
`

scrollTopTemplate = `
window.scrollTo({
left: 0,
top: 0,
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
`

scrollBottomTemplate = `
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'
});
}
Expand All @@ -77,9 +77,9 @@ const (
if (!isInViewport(el)) {
el.scrollIntoView({
behavior: %s,
block: %s,
inline: %s
behavior: '%s',
block: '%s',
inline: '%s'
});
}
Expand Down

0 comments on commit bddf177

Please sign in to comment.