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
c7a592a2
Commit
c7a592a2
authored
Apr 11, 2013
by
Joel Hillacre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the ability for dropdown menus to use bootstrap's ability to drop right.
parent
d0f40bc4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
README.md
README.md
+4
-0
index.html
index.html
+21
-1
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+2
-1
No files found.
README.md
View file @
c7a592a2
...
...
@@ -188,6 +188,10 @@ The used container holding both the dropdown button and the dropdown menu.
});
});
**dropRight**
Define if the menu should drop to the right of the button or not, by adding
`pull-right`
class to
`<ul class="dropdown-menu">`
. Default is false.
**onChange**
Assign an event handler to the change event:
...
...
index.html
View file @
c7a592a2
...
...
@@ -102,6 +102,8 @@
$
(
'
#example23
'
).
multiselect
();
$
(
'
#example24
'
).
multiselect
();
$
(
'
#example25
'
).
multiselect
({
dropRight
:
true
});
});
</script>
<p>
...
...
@@ -378,6 +380,24 @@
Specifiy an alternaitve label for the options:
<code>
<
option label=
"
label
"><
/option
>
</code>
</td>
</tr>
<tr>
<td>
<div
class=
"pull-left"
>
<div
class=
"btn-group"
>
<select
id=
"example25"
multiple=
"multiple"
>
<option
value=
"analysis"
label=
"Ana"
>
Analysis
</option>
<option
value=
"algebra"
label=
"LA"
>
Linear Algebra
</option>
<option
value=
"discrete"
label=
"Discrete"
>
Discrete Mathematics
</option>
<option
value=
"numerical"
label=
"NumA"
>
Numerical Analysis
</option>
<option
value=
"probability"
label=
"Proba"
>
Probability Theory
</option>
</select>
</div>
</div>
</td>
<td>
Make the menu drop right instead of dropping left with
<code>
dropRight
</code>
.
</td>
</tr>
</table>
<div
class=
"page-header"
>
<h1>
Code
</h1>
...
...
js/bootstrap-multiselect.js
View file @
c7a592a2
...
...
@@ -61,7 +61,7 @@
this
.
$container
=
$
(
this
.
options
.
buttonContainer
)
.
append
(
'
<button type="button" class="multiselect dropdown-toggle
'
+
this
.
options
.
buttonClass
+
'
" data-toggle="dropdown">
'
+
this
.
options
.
buttonText
(
this
.
getSelected
(),
this
.
$select
)
+
'
</button>
'
)
.
append
(
'
<ul class="dropdown-menu"></ul>
'
);
.
append
(
'
<ul class="dropdown-menu
'
+
(
this
.
options
.
dropRight
?
'
pull-right
'
:
''
)
+
'
"></ul>
'
);
if
(
this
.
options
.
buttonWidth
)
{
$
(
'
button
'
,
this
.
$container
).
css
({
...
...
@@ -113,6 +113,7 @@
},
buttonClass
:
'
btn
'
,
dropRight
:
false
,
selectedClass
:
'
active
'
,
buttonWidth
:
'
auto
'
,
buttonContainer
:
'
<div class="btn-group" />
'
,
...
...
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