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
81df620e
Commit
81df620e
authored
Mar 13, 2013
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #33 from nghtstr/patch-1
Added handling for option groups.
parents
29f64e4d
e9ccd61b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
214 additions
and
199 deletions
+214
-199
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+214
-199
No files found.
js/bootstrap-multiselect.js
View file @
81df620e
...
...
@@ -115,7 +115,8 @@
buttonContainer
:
'
<div class="btn-group" />
'
,
// Maximum height of thet dropdown menu.
// If maximum height is exceeded a scrollbar will be displayed.
maxHeight
:
400
maxHeight
:
400
,
showGroups
:
false
,
},
isMobile
:
function
()
{
...
...
@@ -124,10 +125,7 @@
constructor
:
Multiselect
,
buildDrowdown
:
function
(
select
,
options
){
// Build the dropdown.
$
(
'
option
'
,
this
.
$select
).
each
(
$
.
proxy
(
function
(
index
,
element
)
{
createOptionValue
:
function
(
element
)
{
if
(
$
(
element
).
is
(
'
:selected
'
))
{
$
(
element
).
attr
(
'
selected
'
,
'
selected
'
);
$
(
element
).
prop
(
'
selected
'
,
'
selected
'
);
...
...
@@ -147,7 +145,24 @@
if
(
selected
)
{
checkbox
.
parents
(
'
li
'
).
addClass
(
'
active
'
);
}
},
buildDrowdown
:
function
(
select
,
options
){
// Build the dropdown.
if
((
this
.
options
.
showGroups
)
&&
(
$
(
'
optgroup
'
,
this
.
$select
).
length
>
0
))
{
$
(
'
optgroup
'
,
this
.
$select
).
each
(
$
.
proxy
(
function
(
index
,
group
)
{
var
groupName
=
$
(
group
).
prop
(
'
label
'
);
$
(
'
ul
'
,
this
.
$container
).
append
(
'
<li><label style="margin:0;padding:3px 20px 3px 20px;width:100%;height:100%;" class="multiselect-group">
'
+
groupName
+
'
</label></li>
'
);
$
(
'
option
'
,
group
).
each
(
$
.
proxy
(
function
(
index
,
element
)
{
this
.
createOptionValue
(
element
);
},
this
));
},
this
));
}
else
{
$
(
'
option
'
,
this
.
$select
).
each
(
$
.
proxy
(
function
(
index
,
element
)
{
this
.
createOptionValue
(
element
);
},
this
));
}
// Bind the change event on the dropdown elements.
$
(
'
ul li input[type="checkbox"]
'
,
this
.
$container
).
on
(
'
change
'
,
$
.
proxy
(
function
(
event
)
{
...
...
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