Commit a338b466 authored by Tejesh's avatar Tejesh 🖖
Browse files

remove code

parent f36fcc50
Pipeline #77100 failed with stage
in 1 minute and 34 seconds
......@@ -417,49 +417,6 @@ function sortHandler($this) {
window.location.hash = '#' + parse(location.hash.replace(/^#/, '')).update(filter, data_mode)
})
// Checks if location.hash is empty and updates hash accordingly
function hashUpdater(event) {
event.preventDefault()
var hrefVal = event.target.getAttribute('href')
if (hrefVal == "?_sort=") {
window.location.hash = ""
} else {
var stripHrefVal = parse(hrefVal).searchList._sort[0]
if (window.location.hash != "") {
var updatedHash = newHashGenerator(stripHrefVal, hrefVal)
updatedHash.startsWith("&") ? window.location.hash = window.location.hash.substring(1) + updatedHash : window.location.hash = updatedHash
} else {
window.location.hash = hrefVal
}
}
}
/* Searches the url and returns a modified hash value.
Deletes same value of href if found and returns a new hash*/
function newHashGenerator(val, hRef) {
var currentHash = window.location.hash
var searchPosi = currentHash.search("=" + val.replace("-", ""))
var searchNega = currentHash.search("-" + val)
var origSearch = currentHash.search("=" + val)
var valueT = currentHash.search("&" + hRef.substring(1))
var newHash
if (origSearch != -1) {
newHash = (valueT != -1) ? currentHash.replace("&" + hRef.substring(1), "") : currentHash.replace(hRef.substring(1), "").replace("?&", "?")
return newHash
} else if (searchPosi != -1) {
newHash = currentHash.substring(0, searchPosi + 1) + "-" + currentHash.substring(searchPosi + 1)
return newHash
} else if (searchNega != -1) {
newHash = currentHash.substring(0, searchNega) + currentHash.substring(searchNega).substring(1)
return newHash
} else {
newHash = "&" + hRef.replace("?", "")
return newHash
}
}
}
function remove_quotes(str) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment