Sha256: 1f0bef34515dd3151ae57e1055d85442da2dc13208db052f448aee8819b049fe

Contents?: true

Size: 1.52 KB

Versions: 103

Compression:

Stored size: 1.52 KB

Contents

let letterCloseButton = document.querySelector('.letter-close-button')
let txtBox = document.querySelector('.txtBox')
let focusBorder = document.querySelector('.focus-border')
txtBox.focus()
document.querySelector(".serachBtn").value = ""

function myFunction(x) {
    if (x.matches) {
        txtBox.addEventListener("click", () => {
            document.documentElement.scrollTop = 200
            setTimeout(() => {
                document.documentElement.scrollTop = 200
            }, 150);
        })
    } else {
        console.log("false");
    }
}
var x = window.matchMedia("(max-width: 768px)")
// myFunction(x)
// x.addListener(myFunction)

txtBox.addEventListener('input', (e) => {
    if (e.target.value === "") {
        letterCloseButton.style.display = "none"
        // letterCloseButton.classList.remove("close_ltr_icon")
    }
    else {
        letterCloseButton.style.display = "block"
        // letterCloseButton.classList.add("close_ltr_icon")
    }

    focusBorder.classList.remove("focus-border")
    e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
    let rangeOfBlankTile = 3
    if (rangeOfBlankTile === "") {
        rangeOfBlankTile = 3
    }
    e.target.value = e.target.value.replace(/ /g, '?')
    let data = []
    data = e.target.value.split('').filter((i) => i === '?')
    if (data.length > rangeOfBlankTile) {
        e.target.value = e.target.value.replace(/\?$/, '')
    }
})

letterCloseButton.addEventListener("click", () => {
    txtBox.value = ""
    letterCloseButton.style.display ="none"
})


Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
word-games-theme-2.8.6 assets/js/default.js
word-games-theme-2.7.9 assets/js/default.js
word-games-theme-2.7.8 assets/js/default.js
word-games-theme-2.7.7 assets/js/default.js
word-games-theme-2.7.6 assets/js/default.js
word-games-theme-2.7.5 assets/js/default.js
word-games-theme-2.7.4 assets/js/default.js
word-games-theme-2.7.3 assets/js/default.js
word-games-theme-2.7.2 assets/js/default.js
word-games-theme-2.7.1 assets/js/default.js
word-games-theme-2.7.0 assets/js/default.js
word-games-theme-2.6.9 assets/js/default.js
word-games-theme-2.6.8 assets/js/default.js
word-games-theme-2.6.7 assets/js/default.js
word-games-theme-2.6.6 assets/js/default.js
word-games-theme-2.6.5 assets/js/default.js
word-games-theme-2.6.4 assets/js/default.js
word-games-theme-2.6.3 assets/js/default.js
word-games-theme-2.6.2 assets/js/default.js
word-games-theme-2.6.1 assets/js/default.js