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
1a8a6c67
Commit
1a8a6c67
authored
Mar 13, 2013
by
Mike Eggleston
Committed by
David Stutz
Mar 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update bootstrap-multiselect.js
This allows for the handling of optgroups as a header inside of the dropdown.
parent
a048af2e
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 @
1a8a6c67
...
...
@@ -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