Commit b97ced0f authored by David Stutz's avatar David Stutz

#334 and #283.

parent 3a6b377c
......@@ -805,7 +805,7 @@ $(document).ready(function() {
<td><code>onDropdownShow</code></td>
<td>
<p>
This event handler is triggered when the dropdown are shown.
This event handler is triggered when the dropdown is shown.
</p>
<p class="alert alert-warning">
Both, the <code>onDropdownShow</code> and the <code>onDropdownHide</code> options are not supported when using Twitter Bootstrap 2.3.x.
......@@ -829,7 +829,7 @@ $(document).ready(function() {
<td><code>onDropdownHide</code></td>
<td>
<p>
This event handler is triggered when the dropdown are hidden.
This event handler is triggered when the dropdown is hidden.
</p>
<p class="alert alert-warning">
Both, the <code>onDropdownShow</code> and the <code>onDropdownHide</code> options are not supported when using Twitter Bootstrap 2.3.x.
......@@ -848,7 +848,55 @@ $(document).ready(function() {
&lt;/script&gt;
</pre>
</td>
</tr>
</tr>
<tr>
<td><code>onDropdownShown</code></td>
<td>
<p>
This event handler is triggered <i>after</i> the dropdown is shown.
</p>
<p class="alert alert-warning">
Both, the <code>onDropdownShown</code> and the <code>onDropdownHidden</code> options are not supported when using Twitter Bootstrap 2.3.x.
</p>
</td>
<td>
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$(&#39;.multiselect&#39;).multiselect({
onDropdownShown: function(event) {
alert(&apos;Shown event invoked!&apos;);
}
});
});
&lt;/script&gt;
</pre>
</td>
</tr>
<tr>
<td><code>onDropdownHidden</code></td>
<td>
<p>
This event handler is triggered <i>after</i> the dropdown are hidden.
</p>
<p class="alert alert-warning">
Both, the <code>onDropdownShown</code> and the <code>onDropdownHidden</code> options are not supported when using Twitter Bootstrap 2.3.x.
</p>
</td>
<td>
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$(&#39;.multiselect&#39;).multiselect({
onDropdownHidden: function(event) {
alert(&apos;Hidden event invoked!&apos;);
}
});
});
&lt;/script&gt;
</pre>
</td>
</tr>
<tr>
<td><code>maxHeight</code></td>
<td>
......@@ -2366,6 +2414,13 @@ validator.settings.ignore = ':hidden:not(".multiselect")';
<p>
This issue is mainly due to the default behavior of most browsers. A workaround can be found here: <a href="https://github.com/davidstutz/bootstrap-multiselect/issues/129">#129</a>.
</p>
<p>
<b>Which are the minimum required components of Twitter Botostrap to get the plugin working?</b>
</p>
<p>
The plugin needs at least the styles for forms and dropdowns. In addition the JavaScript dropdown plugin from Twitter Bootstrap is required. Details can be found here: <a href="https://github.com/davidstutz/bootstrap-multiselect/issues/344">#344</a>.
</p>
</div>
<div class="container">
......
......@@ -104,7 +104,9 @@
this.options.onChange = $.proxy(this.options.onChange, this);
this.options.onDropdownShow = $.proxy(this.options.onDropdownShow, this);
this.options.onDropdownHide = $.proxy(this.options.onDropdownHide, this);
this.options.onDropdownShown = $.proxy(this.options.onDropdownShown, this);
this.options.onDropdownHidden = $.proxy(this.options.onDropdownHidden, this);
// Build select all if enabled.
this.buildContainer();
this.buildButton();
......@@ -201,6 +203,22 @@
*/
onDropdownHide: function(event) {
},
/**
* Triggered after the dropdown is shown.
*
* @param {jQuery} event
*/
onDropdownShown: function(event) {
},
/**
* Triggered after the dropdown is hidden.
*
* @param {jQuery} event
*/
onDropdownHidden: function(event) {
},
buttonClass: 'btn btn-default',
dropRight: false,
......@@ -243,6 +261,8 @@
this.$container = $(this.options.buttonContainer);
this.$container.on('show.bs.dropdown', this.options.onDropdownShow);
this.$container.on('hide.bs.dropdown', this.options.onDropdownHide);
this.$container.on('shown.bs.dropdown', this.options.onDropdownShown);
this.$container.on('hidden.bs.dropdown', this.options.onDropdownHidden);
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment