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
1b3a01d1
Commit
1b3a01d1
authored
Nov 13, 2013
by
David Stutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#181
parent
9c44c2a0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
3 deletions
+53
-3
bootstrap-3.0.0.min.css
css/bootstrap-3.0.0.min.css
+1
-1
index.html
index.html
+50
-0
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+1
-1
variables.less
less/variables.less
+1
-1
No files found.
css/bootstrap-3.0.0.min.css
View file @
1b3a01d1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
index.html
View file @
1b3a01d1
...
...
@@ -1284,6 +1284,31 @@ $("#multiselect").multiselect('dataprovider', data);
var
orderCount
=
0
;
$
(
'
#example38
'
).
multiselect
({
buttonText
:
function
(
options
)
{
if
(
options
.
length
==
0
)
{
return
'
None selected <b class="caret"></b>
'
;
}
else
if
(
options
.
length
>
3
)
{
return
options
.
length
+
'
selected <b class="caret"></b>
'
;
}
else
{
var
selected
=
[];
options
.
each
(
function
()
{
selected
.
push
([
$
(
this
).
text
(),
$
(
this
).
data
(
'
order
'
)]);
});
;
selected
.
sort
(
function
(
a
,
b
)
{
return
a
[
1
]
-
b
[
1
];
})
var
text
=
''
;
for
(
var
i
=
0
;
i
<
selected
.
length
;
i
++
)
{
text
+=
selected
[
i
][
0
]
+
'
,
'
;
}
return
text
.
substr
(
0
,
text
.
length
-
2
)
+
'
<b class="caret"></b>
'
;
}
},
onChange
:
function
(
option
,
checked
)
{
if
(
checked
)
{
orderCount
++
;
...
...
@@ -1638,6 +1663,31 @@ $("#multiselect").multiselect('dataprovider', data);
$(document).ready(function() {
var orderCount = 0;
$('#example38').multiselect({
buttonText: function(options) {
if (options.length == 0) {
return 'None selected
<b
class=
"caret"
></b>
';
}
else if (options.length > 3) {
return options.length + ' selected
<b
class=
"caret"
></b>
';
}
else {
var selected = [];
options.each(function() {
selected.push([$(this).text(), $(this).data('order')]);
});
selected.sort(function(a, b) {
return a[1] - b[1];
})
var text = '';
for (var i = 0; i
<
selected
.
length
;
i
++)
{
text
+=
selected
[
i
][
0
]
+
',
';
}
return
text
.
substr
(
0
,
text
.
length
-2
)
+
'
<
b
class=
"caret"
></b>
';
}
},
onChange: function(option, checked) {
if (checked) {
orderCount++;
...
...
js/bootstrap-multiselect.js
View file @
1b3a01d1
...
...
@@ -272,9 +272,9 @@
$option
.
prop
(
'
selected
'
,
false
);
}
this
.
updateButtonText
();
this
.
$select
.
change
();
this
.
options
.
onChange
(
$option
,
checked
);
this
.
updateButtonText
();
if
(
this
.
options
.
preventInputChangeEvent
)
{
return
false
;
...
...
less/variables.less
View file @
1b3a01d1
...
...
@@ -44,7 +44,7 @@
@font-family-monospace: Monaco, Menlo, Consolas, "Courier New", monospace;
@font-family-base: @font-family-sans-serif;
@font-size-base: 1
4
px;
@font-size-base: 1
5
px;
@font-size-large: ceil(@font-size-base * 1.25); // ~18px
@font-size-small: ceil(@font-size-base * 0.85); // ~12px
...
...
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