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
3a0948ac
Commit
3a0948ac
authored
Nov 08, 2013
by
David Stutz
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #173 from rzcoder/master
Add support for show/hide events.
parents
eb469cb2
368f2bf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
index.html
index.html
+38
-0
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+12
-0
No files found.
index.html
View file @
3a0948ac
...
...
@@ -665,6 +665,44 @@
</pre>
</td>
</tr>
<tr>
<td><code>
onDropdownShow
</code></td>
<td>
This event handler is triggered when the dropdown are shown.
</td>
<td>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
$(
'
.multiselect
'
).multiselect({
onDropdownShow: function(event) {
alert(
'
Show event invoked!
'
);
}
});
});
<
/script
>
</pre>
</td>
</tr>
<tr>
<td><code>
onDropdownHide
</code></td>
<td>
This event handler is triggered when the dropdown are hidden.
</td>
<td>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
$(
'
.multiselect
'
).multiselect({
onDropdownHide: function(event) {
alert(
'
Hide event invoked!
'
);
}
});
});
<
/script
>
</pre>
</td>
</tr>
<tr>
<td><code>
maxHeight
</code></td>
<td>
...
...
js/bootstrap-multiselect.js
View file @
3a0948ac
...
...
@@ -39,6 +39,8 @@
this
.
options
.
multiple
=
this
.
$select
.
attr
(
'
multiple
'
)
==
"
multiple
"
;
this
.
options
.
onChange
=
$
.
proxy
(
this
.
options
.
onChange
,
this
);
this
.
options
.
onDropdownShow
=
$
.
proxy
(
this
.
options
.
onDropdownShow
,
this
);
this
.
options
.
onDropdownHide
=
$
.
proxy
(
this
.
options
.
onDropdownHide
,
this
);
// Build select all if enabled.
this
.
buildContainer
();
...
...
@@ -98,6 +100,14 @@
// Is triggered on change of the selected options.
onChange
:
function
(
option
,
checked
)
{
},
// Triggered immediately when dropdown shown
onDropdownShow
:
function
(
event
)
{
},
// Triggered immediately when dropdown hidden
onDropdownHide
:
function
(
event
)
{
},
buttonClass
:
'
btn
'
,
dropRight
:
false
,
...
...
@@ -134,6 +144,8 @@
buildContainer
:
function
()
{
this
.
$container
=
$
(
this
.
options
.
buttonContainer
);
this
.
$container
.
on
(
'
show.bs.dropdown
'
,
this
.
options
.
onDropdownShow
);
this
.
$container
.
on
(
'
hide.bs.dropdown
'
,
this
.
options
.
onDropdownHide
);
},
buildButton
:
function
()
{
...
...
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