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
8ab9f25d
Commit
8ab9f25d
authored
Jan 24, 2019
by
Pratap Vardhan
Browse files
BUG: formhandler clear all removes all params
parent
d9984e46
Pipeline
#75684
passed with stage
in 2 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/formhandler.template.html
View file @
8ab9f25d
...
...
@@ -327,7 +327,7 @@ Each template receives these variables:
_.each
(
args
[
key
],
function
(
col_name
)
{
var
update =
{}
update[key] =
col_name
qparts.update
(
update
)
%
>
qparts.update
(
update
,
'
add
'
)
%
>
<a
href=
"?<%- key %>=<%- col_name %>"
data-mode=
"del"
class=
"badge badge-pill badge-dark urlfilter"
title=
"Clear <%- key %> filter"
>
<
%
-
key
%
>
=
<
%
-
col_name
%
>
</a>
...
...
test/test-formhandler.html
View file @
8ab9f25d
...
...
@@ -65,6 +65,7 @@
<div
class=
"custom_buttons4"
data-src=
"/formhandler-data"
></div>
<div
class=
"custom_buttons5"
data-src=
"/formhandler-data"
></div>
<div
class=
"fh18"
data-src=
"/formhandler-data"
></div>
<div
class=
"fh17"
data-src=
"/formhandler-data"
></div>
<div
class=
"fh15"
data-src=
"/formhandler-data"
></div>
<div
class=
"fh16"
data-src=
"/formhandler-data"
></div>
...
...
@@ -538,6 +539,19 @@
t
.
end
()
})
})
tape
(
'
$().formhandler() test clear all for multiple filters
'
,
function
(
t
)
{
window
.
history
.
pushState
({},
''
,
'
#
'
)
window
.
history
.
pushState
({},
''
,
'
#
'
+
g1
.
url
.
parse
().
update
({
'
Continent
'
:
[
'
Asia
'
,
'
Europe
'
],
_limit
:
5
}).
toString
())
$
(
'
.fh18
'
).
formhandler
()
.
on
(
'
load
'
,
function
()
{
var
filter_badges
=
$
(
'
body > div.fh18 > div.position-relative > div.formhandler > div.formhandler-table-header > div.d-flex > div.filters > div > a
'
)
t
.
equal
(
filter_badges
[
0
].
text
.
trim
(),
'
Continent = Asia
'
)
t
.
equal
(
filter_badges
[
1
].
text
.
trim
(),
'
Continent = Europe
'
)
t
.
equal
(
filter_badges
[
2
].
getAttribute
(
'
href
'
),
'
?Continent=Asia&Continent=Europe
'
)
window
.
history
.
pushState
({},
''
,
'
#
'
)
t
.
end
()
})
})
// tape('$().formhandler() add new rows', function (t) {
// $('.fh_add1')
// .formhandler({
...
...
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