1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-01-26 03:51:57 +02:00
2019-09-07 12:59:37 -04:00

29 lines
382 B
Go

package templates
import (
"fmt"
"github.com/MontFerret/ferret/pkg/drivers"
)
func Blur() string {
return `
(el) => {
el.blur()
}
`
}
func BlurBySelector(selector string) string {
return fmt.Sprintf(`
(parent) => {
const el = parent.querySelector('%s');
if (el == null) {
throw new Error('%s')
}
el.blur();
}
`, selector, drivers.ErrNotFound)
}