Skip to content

Commit

Permalink
Fix unnecessary JS in blog pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiancc committed Feb 20, 2024
1 parent 1cf7c29 commit 93dee8b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
Empty file removed _site/js/blog.js
Empty file.
18 changes: 11 additions & 7 deletions _site/js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let height = 591;
let peekVal = document.querySelector(".item").clientWidth
let height = 591, peekVal;
const page = document.location.pathname

function openCollapsible(button) {
height = 591
Expand Down Expand Up @@ -45,7 +45,6 @@ var iotGlide = new Glide('#iot-glide', {
before: peekVal,
after: peekVal
}})
peek()

function peek () {
peekVal = document.querySelector(".carousel").clientWidth
Expand Down Expand Up @@ -84,7 +83,12 @@ function peek () {
}


iaGlide.mount()
iotGlide.mount()
peek()
window.addEventListener("resize", peek);
if (page == "/") {
peek()
peekVal = document.querySelector(".item").clientWidth
iaGlide.mount()
iotGlide.mount()
peek()
window.addEventListener("resize", peek);

}
Empty file removed js/blog.js
Empty file.
18 changes: 11 additions & 7 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let height = 591;
let peekVal = document.querySelector(".item").clientWidth
let height = 591, peekVal;
const page = document.location.pathname

function openCollapsible(button) {
height = 591
Expand Down Expand Up @@ -45,7 +45,6 @@ var iotGlide = new Glide('#iot-glide', {
before: peekVal,
after: peekVal
}})
peek()

function peek () {
peekVal = document.querySelector(".carousel").clientWidth
Expand Down Expand Up @@ -84,7 +83,12 @@ function peek () {
}


iaGlide.mount()
iotGlide.mount()
peek()
window.addEventListener("resize", peek);
if (page == "/") {
peek()
peekVal = document.querySelector(".item").clientWidth
iaGlide.mount()
iotGlide.mount()
peek()
window.addEventListener("resize", peek);

}

0 comments on commit 93dee8b

Please sign in to comment.