Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
a338b466
Commit
a338b466
authored
Feb 18, 2019
by
Tejesh
🖖
Browse files
remove code
parent
f36fcc50
Pipeline
#77100
failed with stage
in 1 minute and 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/formhandler.js
View file @
a338b466
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment