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
d9106c68
Commit
d9106c68
authored
Jun 02, 2013
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #96 from nexces/master
Altered filtering behavior.
parents
1e4d201f
11785d83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+18
-9
No files found.
js/bootstrap-multiselect.js
View file @
d9106c68
...
...
@@ -87,15 +87,23 @@
$
.
each
(
$
(
'
.multiselect-container li
'
,
this
.
$container
),
$
.
proxy
(
function
(
index
,
element
)
{
var
value
=
$
(
'
input
'
,
element
).
val
();
if
(
value
!=
this
.
options
.
selectAllValue
)
{
var
$option
=
$
(
'
option[value="
'
+
value
+
'
"]
'
,
this
.
$select
);
var
label
=
$option
.
attr
(
'
label
'
)
||
$option
.
text
();
if
(
value
.
indexOf
(
this
.
query
)
===
-
1
)
{
$
(
element
).
hide
();
}
else
{
$
(
element
).
show
();
}
var
text
=
$
(
'
label
'
,
element
).
text
();
var
value
=
$
(
'
input
'
,
element
).
val
();
if
(
value
&&
text
&&
value
!=
this
.
options
.
selectAllValue
)
{
// by default lets assume that element is not interesting for this search
var
showElement
=
false
;
if
(
(
this
.
options
.
filterBehavior
==
'
text
'
||
this
.
options
.
filterBehavior
==
'
both
'
)
&&
text
.
indexOf
(
this
.
query
)
>
-
1
)
{
showElement
=
true
;
}
if
(
(
this
.
options
.
filterBehavior
==
'
value
'
||
this
.
options
.
filterBehavior
==
'
both
'
)
&&
value
.
indexOf
(
this
.
query
)
>
-
1
)
{
showElement
=
true
;
}
if
(
showElement
)
{
$
(
element
).
show
();
}
else
{
$
(
element
).
hide
();
}
}
}
},
this
));
}
...
...
@@ -152,6 +160,7 @@
selectAllValue
:
'
multiselect-all
'
,
enableFiltering
:
false
,
filterPlaceholder
:
'
Search
'
,
filterBehavior
:
'
text
'
,
// possible options: 'text', 'value', 'both'
},
constructor
:
Multiselect
,
...
...
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