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
4030fcaf
Commit
4030fcaf
authored
Feb 07, 2019
by
S Anand
Browse files
BUG: FormHandler Clear All should remove all params. Fixes
#140
@pratap.vardhan
parent
ed696e32
Pipeline
#75842
passed with stage
in 2 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/formhandler.template.html
View file @
4030fcaf
...
...
@@ -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 @
4030fcaf
...
...
@@ -64,6 +64,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,21 @@
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
=
$
(
'
.fh18 .filters a
'
)
// First two links are the filters ?Continent=Asia and ?Continent=Europe
t
.
equal
(
filter_badges
[
0
].
text
.
trim
(),
'
Continent = Asia
'
)
t
.
equal
(
filter_badges
[
1
].
text
.
trim
(),
'
Continent = Europe
'
)
// 3rd link is the Clear All
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({
...
...
S Anand
@s.anand
mentioned in merge request
!47 (closed)
·
Feb 07, 2019
mentioned in merge request
!47 (closed)
mentioned in merge request !47
Toggle commit list
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