Skip to content

Commit

Permalink
better fix on color filtering long click
Browse files Browse the repository at this point in the history
  • Loading branch information
ForwardFeed committed Apr 26, 2024
1 parent a97bbdd commit f758d1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions static/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,7 @@ export function setupFilters(){
setLongClickSelection($('#to-filter')[0], ()=>{
removeAllFilters()
// remove a color bug on previously added filters buttons
$('.extend').not("#to-filter *").css("backgroundColor", "green")
})
}, ()=>{return "red"})

setupFiltersRow()
}
Expand Down Expand Up @@ -737,7 +736,7 @@ export function longClickToFilter(panelID, node, key, data = ()=>{return node.in
activateSearch()
extendableDiv.style.backgroundColor = color
if (callback) callback()
}, 450, hasFilter(key, data(), panelID) ? "red" : "green")
},()=>{return hasFilter(key, data(), panelID) ? "red" : "green" }, 450)
}

function setupFiltersRow(){
Expand Down
5 changes: 3 additions & 2 deletions static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export function JSHAC(htmlArray){
return frag
}

export function setLongClickSelection(node, callback, time = 500, bgColor = "red"){
export function setLongClickSelection(node, callback, colorCb, time = 500){
const extendableDiv = e("div", "extend")
extendableDiv.style.backgroundColor = bgColor
extendableDiv.style.backgroundColor = colorCb()
extendableDiv.style.display = "none"
node.append(extendableDiv)
node.style.position = "relative"
Expand All @@ -146,6 +146,7 @@ export function setLongClickSelection(node, callback, time = 500, bgColor = "red
hasFired = true
callback()
}, time)
extendableDiv.style.backgroundColor = colorCb()
extendableDiv.animate([
{ width: "0%"},
{ width: "100%"},
Expand Down

0 comments on commit f758d1e

Please sign in to comment.