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
3c219fcc
Commit
3c219fcc
authored
Apr 17, 2016
by
David Stutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Should fix #699, #679, #680 and #655.
parent
13ccb920
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
121 deletions
+147
-121
bootstrap-multiselect.js
dist/js/bootstrap-multiselect.js
+103
-119
index.html
index.html
+42
-0
bootstrap-multiselect.js
tests/spec/bootstrap-multiselect.js
+2
-2
No files found.
dist/js/bootstrap-multiselect.js
View file @
3c219fcc
This diff is collapsed.
Click to expand it.
index.html
View file @
3c219fcc
...
...
@@ -617,6 +617,48 @@
<
/script
>
</pre>
</div>
<p>
Both options,
<code>
enableCollapsibleOptGroups
</code>
and
<code>
enableCollapsibleOptGroups
</code>
, can also be combined:
</p>
<p
class=
"alert alert-warning"
>
Note, however, that the behavior of combining both options might not be as expected - play around with the below example to get some intuition.
</p>
<div
class=
"example"
>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#example-enableCollapsibleOptGroups-enableClickableOptGroups
'
).
multiselect
({
enableClickableOptGroups
:
true
,
enableCollapsibleOptGroups
:
true
});
});
</script>
<select
id=
"example-enableCollapsibleOptGroups-enableClickableOptGroups"
multiple=
"multiple"
>
<optgroup
label=
"Group 1"
>
<option
value=
"1-1"
disabled
>
Option 1.1
</option>
<option
value=
"1-2"
selected=
"selected"
>
Option 1.2
</option>
<option
value=
"1-3"
selected=
"selected"
>
Option 1.3
</option>
</optgroup>
<optgroup
label=
"Group 2"
>
<option
value=
"2-1"
>
Option 2.1
</option>
<option
value=
"2-2"
>
Option 2.2
</option>
<option
value=
"2-3"
>
Option 2.3
</option>
</optgroup>
</select>
</div>
<div
class=
"highlight"
>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
$('#example-enableCollapsibleOptGroups-enableClickableOptGroups').multiselect({
enableClickableOptGroups: true,
enableCollapsibleOptGroups: true
});
});
<
/script
>
</pre>
</td>
</tr>
<tr>
...
...
tests/spec/bootstrap-multiselect.js
View file @
3c219fcc
...
...
@@ -266,7 +266,7 @@ describe('Bootstrap Multiselect "Single Selection"', function() {
});
});
describe
(
'
Bootstrap Multiselect "Optgroups"
'
,
function
()
{
describe
(
'
Bootstrap Multiselect "
Clickable
Optgroups"
'
,
function
()
{
// Count the number of onChanges fired.
var
fired
=
0
;
...
...
@@ -297,7 +297,7 @@ describe('Bootstrap Multiselect "Optgroups"', function() {
it
(
'
Should correctly create labels for optgroups.
'
,
function
()
{
expect
(
$
(
'
#multiselect-container li.multiselect-group
'
).
length
).
toBe
(
10
);
expect
(
$
(
'
#multiselect-container li.multiselect-group
-clickable
'
).
length
).
toBe
(
10
);
expect
(
$
(
'
#multiselect-container li.multiselect-group
input
'
).
length
).
toBe
(
10
);
$
(
'
#multiselect-container label.multiselect-group
'
).
each
(
function
()
{
expect
(
$
(
'
input
'
,
$
(
this
)).
length
).
toBe
(
10
);
...
...
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