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
e7c8abfe
Commit
e7c8abfe
authored
Apr 17, 2016
by
David Stutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for #709.
parent
9ec68114
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
25 deletions
+34
-25
index.html
index.html
+14
-15
bootstrap-multiselect.js
tests/spec/bootstrap-multiselect.js
+20
-10
No files found.
index.html
View file @
e7c8abfe
...
@@ -2990,7 +2990,7 @@
...
@@ -2990,7 +2990,7 @@
<table
class=
"table layout-fixed"
>
<table
class=
"table layout-fixed"
>
<tbody>
<tbody>
<tr>
<tr>
<td>
<td
width=
"30%"
>
<code>
.multiselect('destroy')
</code>
<code>
.multiselect('destroy')
</code>
</td>
</td>
<td>
<td>
...
@@ -3998,19 +3998,11 @@
...
@@ -3998,19 +3998,11 @@
<
select id=
"
example-dataprovider-optgroups
"
multiple=
"
multiple
"><
/select
>
<
select id=
"
example-dataprovider-optgroups
"
multiple=
"
multiple
"><
/select
>
</pre>
</pre>
</div>
</div>
</td>
</tr>
<tr>
<td>
</td>
<td>
<p>
<p>
You can add custom data attributes on option group children and non-grouped options:
You can add custom data attributes on option group children and non-grouped options:
</p>
</p>
<p>
Renders as:
<pre
class=
"prettyprint"
>
<
option value=
"
1
"
label=
"
Option 1
"
selected=
"
selected
"
data-some-attribute=
"
1
"
data-another-attribute=
"
false
"><
/option
>
<
option value=
"
2
"
label=
"
Option 2
"
data-some-attribute=
"
2
"><
/option
>
</pre>
</p>
<div
class=
"example"
>
<div
class=
"example"
>
<div
class=
"btn-group"
>
<div
class=
"btn-group"
>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
...
@@ -4072,6 +4064,13 @@
...
@@ -4072,6 +4064,13 @@
</pre>
</pre>
</div>
</div>
</div>
</div>
<p>
Renders as:
</p>
<pre
class=
"prettyprint"
>
<
option value=
"
1
"
label=
"
Option 1
"
selected=
"
selected
"
data-some-attribute=
"
1
"
data-another-attribute=
"
false
"><
/option
>
<
option value=
"
2
"
label=
"
Option 2
"
data-some-attribute=
"
2
"><
/option
>
</pre>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
...
...
tests/spec/bootstrap-multiselect.js
View file @
e7c8abfe
...
@@ -368,6 +368,10 @@ describe('Bootstrap Multiselect "Dataprovider"', function() {
...
@@ -368,6 +368,10 @@ describe('Bootstrap Multiselect "Dataprovider"', function() {
{
label
:
'
Option 6
'
,
value
:
'
6
'
,
title
:
'
Option 6 Title
'
}
{
label
:
'
Option 6
'
,
value
:
'
6
'
,
title
:
'
Option 6 Title
'
}
];
];
var
options_attributes
=
[
{
label
:
'
Option 1
'
,
value
:
'
1
'
,
attributes
:
{
'
some-attribute
'
:
'
test
'
}}
];
it
(
"
Should be able to add options.
"
,
function
()
{
it
(
"
Should be able to add options.
"
,
function
()
{
$
(
'
#multiselect
'
).
multiselect
(
'
dataprovider
'
,
options
);
$
(
'
#multiselect
'
).
multiselect
(
'
dataprovider
'
,
options
);
expect
(
$
(
'
#multiselect option
'
).
length
).
toBe
(
6
);
expect
(
$
(
'
#multiselect option
'
).
length
).
toBe
(
6
);
...
@@ -416,6 +420,12 @@ describe('Bootstrap Multiselect "Dataprovider"', function() {
...
@@ -416,6 +420,12 @@ describe('Bootstrap Multiselect "Dataprovider"', function() {
expect
(
$
(
'
#multiselect-container input[value="6"]
'
).
closest
(
'
label
'
).
attr
(
'
title
'
)).
toBe
(
'
Option 6 Title
'
);
expect
(
$
(
'
#multiselect-container input[value="6"]
'
).
closest
(
'
label
'
).
attr
(
'
title
'
)).
toBe
(
'
Option 6 Title
'
);
});
});
it
(
"
Should be able to define data attributes.
"
,
function
()
{
$
(
'
#multiselect
'
).
multiselect
(
'
dataprovider
'
,
options_attributes
)
expect
(
$
(
'
#multiselect option[value="1"]
'
).
attr
(
'
value
'
)).
toBe
(
'
1
'
);
expect
(
$
(
'
#multiselect option[value="1"]
'
).
attr
(
'
data-some-attribute
'
)).
toBe
(
'
test
'
);
});
var
optgroups
=
[
var
optgroups
=
[
{
{
label
:
'
Group 1
'
,
children
:
[
label
:
'
Group 1
'
,
children
:
[
...
@@ -630,7 +640,7 @@ describe('Bootstrap Multiselect "Select All".', function() {
...
@@ -630,7 +640,7 @@ describe('Bootstrap Multiselect "Select All".', function() {
});
});
});
});
describe
(
'
Bootstrap Multiselect Specific Issues
'
,
function
()
{
describe
(
'
Bootstrap Multiselect Specific Issues
.
'
,
function
()
{
it
(
'
#393
'
,
function
()
{
it
(
'
#393
'
,
function
()
{
var
$select
=
$
(
'
<select id="multiselect" multiple="multiple"></select>
'
);
var
$select
=
$
(
'
<select id="multiselect" multiple="multiple"></select>
'
);
...
@@ -706,7 +716,7 @@ describe('Bootstrap Multiselect Specific Issues', function() {
...
@@ -706,7 +716,7 @@ describe('Bootstrap Multiselect Specific Issues', function() {
});
});
});
});
describe
(
'
Knockout Binding
'
,
function
()
{
describe
(
'
Knockout Binding
.
'
,
function
()
{
var
$testArea
;
var
$testArea
;
afterEach
(
function
()
{
afterEach
(
function
()
{
if
(
$testArea
)
{
if
(
$testArea
)
{
...
@@ -714,7 +724,7 @@ describe('Knockout Binding', function() {
...
@@ -714,7 +724,7 @@ describe('Knockout Binding', function() {
}
}
});
});
it
(
'
Should update values and options with an observable array
'
,
function
()
{
it
(
'
Should update values and options with an observable array
.
'
,
function
()
{
jasmine
.
clock
().
install
();
jasmine
.
clock
().
install
();
$testArea
=
$
(
'
<select multiple="multiple" data-bind="selectedOptions: myValues, options: myOptions, multiselect: {numberDisplayed: 1}"></select>
'
).
appendTo
(
document
.
body
);
$testArea
=
$
(
'
<select multiple="multiple" data-bind="selectedOptions: myValues, options: myOptions, multiselect: {numberDisplayed: 1}"></select>
'
).
appendTo
(
document
.
body
);
...
...
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