Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap-multiselect
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap-multiselect
Commits
40bbecbf
Commit
40bbecbf
authored
Oct 13, 2014
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #391 from Tyf0x/fix_#374
#374. Added optional clear button for filter feature.
parents
4690752e
2138cd25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
bootstrap-multiselect.css
css/bootstrap-multiselect.css
+1
-1
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+15
-0
bootstrap-multiselect.less
less/bootstrap-multiselect.less
+8
-0
No files found.
css/bootstrap-multiselect.css
View file @
40bbecbf
.multiselect-container
{
position
:
absolute
;
list-style-type
:
none
;
margin
:
0
;
padding
:
0
}
.multiselect-container
.input-group
{
margin
:
5px
}
.multiselect-container
>
li
{
padding
:
0
}
.multiselect-container
>
li
>
a
.multiselect-all
label
{
font-weight
:
700
}
.multiselect-container
>
li
>
label
.multiselect-group
{
margin
:
0
;
padding
:
3px
20px
;
height
:
100%
;
font-weight
:
700
}
.multiselect-container
>
li
>
a
{
padding
:
0
}
.multiselect-container
>
li
>
a
>
label
{
margin
:
0
;
height
:
100%
;
cursor
:
pointer
;
font-weight
:
400
;
padding
:
3px
20px
3px
40px
}
.multiselect-container
>
li
>
a
>
label
.radio
,
.multiselect-container
>
li
>
a
>
label
.checkbox
{
margin
:
0
}
.multiselect-container
>
li
>
a
>
label
>
input
[
type
=
checkbox
]
{
margin-bottom
:
5px
}
.btn-group
>
.btn-group
:nth-child
(
2
)>
.multiselect.btn
{
border-top-left-radius
:
4px
;
border-bottom-left-radius
:
4px
}
.form-inline
.multiselect-container
label
.checkbox
,
.form-inline
.multiselect-container
label
.radio
{
padding
:
3px
20px
3px
40px
}
.form-inline
.multiselect-container
li
a
label
.checkbox
input
[
type
=
checkbox
],
.form-inline
.multiselect-container
li
a
label
.radio
input
[
type
=
radio
]
{
margin-left
:
-20px
;
margin-right
:
0
}
\ No newline at end of file
.multiselect-container
{
position
:
absolute
;
list-style-type
:
none
;
margin
:
0
;
padding
:
0
}
.multiselect-container
.input-group
{
margin
:
5px
}
.multiselect-container
>
li
{
padding
:
0
}
.multiselect-container
>
li
>
a
.multiselect-all
label
{
font-weight
:
700
}
.multiselect-container
>
li
>
label
.multiselect-group
{
margin
:
0
;
padding
:
3px
20px
;
height
:
100%
;
font-weight
:
700
}
.multiselect-container
>
li
>
a
{
padding
:
0
}
.multiselect-container
>
li
>
a
>
label
{
margin
:
0
;
height
:
100%
;
cursor
:
pointer
;
font-weight
:
400
;
padding
:
3px
20px
3px
40px
}
.multiselect-container
>
li
>
a
>
label
.radio
,
.multiselect-container
>
li
>
a
>
label
.checkbox
{
margin
:
0
}
.multiselect-container
>
li
>
a
>
label
>
input
[
type
=
checkbox
]
{
margin-bottom
:
5px
}
.btn-group
>
.btn-group
:nth-child
(
2
)>
.multiselect.btn
{
border-top-left-radius
:
4px
;
border-bottom-left-radius
:
4px
}
.form-inline
.multiselect-container
label
.checkbox
,
.form-inline
.multiselect-container
label
.radio
{
padding
:
3px
20px
3px
40px
}
.form-inline
.multiselect-container
li
a
label
.checkbox
input
[
type
=
checkbox
],
.form-inline
.multiselect-container
li
a
label
.radio
input
[
type
=
radio
]
{
margin-left
:
-20px
;
margin-right
:
0
}
.multiselect-container
.filter
.btn
{
padding
:
6px
3px
;}
.multiselect-container
.filter
.btn
:hover
{
color
:
red
;}
\ No newline at end of file
js/bootstrap-multiselect.js
View file @
40bbecbf
...
...
@@ -246,6 +246,7 @@
filterPlaceholder
:
'
Search
'
,
// possible options: 'text', 'value', 'both'
filterBehavior
:
'
text
'
,
includeFilterClearBtn
:
false
,
preventInputChangeEvent
:
false
,
nonSelectedText
:
'
None selected
'
,
nSelectedText
:
'
selected
'
,
...
...
@@ -255,6 +256,7 @@
button
:
'
<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>
'
,
ul
:
'
<ul class="multiselect-container dropdown-menu"></ul>
'
,
filter
:
'
<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>
'
,
filterClearBtn
:
'
<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>
'
,
li
:
'
<li><a href="javascript:void(0);"><label></label></a></li>
'
,
divider
:
'
<li class="multiselect-item divider"></li>
'
,
liGroup
:
'
<li class="multiselect-item group"><label class="multiselect-group"></label></li>
'
...
...
@@ -697,6 +699,19 @@
this
.
$filter
=
$
(
this
.
options
.
templates
.
filter
);
$
(
'
input
'
,
this
.
$filter
).
attr
(
'
placeholder
'
,
this
.
options
.
filterPlaceholder
);
// Adds optional filter clear button
if
(
this
.
options
.
includeFilterClearBtn
){
var
clearBtn
=
$
(
this
.
options
.
templates
.
filterClearBtn
);
clearBtn
.
on
(
'
click
'
,
$
.
proxy
(
function
(
event
){
clearTimeout
(
this
.
searchTimeout
);
this
.
$filter
.
find
(
'
.multiselect-search
'
).
val
(
''
);
$
(
'
li
'
,
this
.
$ul
).
show
().
removeClass
(
"
filter-hidden
"
);
this
.
updateSelectAll
();
},
this
));
this
.
$filter
.
find
(
'
.input-group
'
).
append
(
clearBtn
);
}
this
.
$ul
.
prepend
(
this
.
$filter
);
this
.
$filter
.
val
(
this
.
query
).
on
(
'
click
'
,
function
(
event
)
{
...
...
less/bootstrap-multiselect.less
View file @
40bbecbf
...
...
@@ -52,6 +52,14 @@
}
}
.filter .btn {
padding: 6px 3px;
}
.filter .btn:hover {
color: red;
}
.btn-group > .btn-group:nth-child(2) > .multiselect.btn {
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
...
...
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