Commit 5c3beca3 authored by David Stutz's avatar David Stutz

Added tabindex to button.

parent ffc5a47f
...@@ -135,6 +135,8 @@ ...@@ -135,6 +135,8 @@
enableFiltering: true, enableFiltering: true,
maxHeight: 150 maxHeight: 150
}); });
$('#example32').multiselect();
}); });
</script> </script>
<p> <p>
...@@ -482,6 +484,21 @@ ...@@ -482,6 +484,21 @@
The multiselect will adopt the state of the select: <code>&lt;select disabled&gt;&lt;/select&gt;</code>. The multiselect will adopt the state of the select: <code>&lt;select disabled&gt;&lt;/select&gt;</code>.
</td> </td>
</tr> </tr>
<tr>
<td>
<select id="example32" multiple="multiple" tabindex="1">
<option value="cheese">Cheese</option>
<option value="tomatoes">Tomatoes</option>
<option value="mozarella">Mozzarella</option>
<option value="mushrooms">Mushrooms</option>
<option value="pepperoni">Pepperoni</option>
<option value="onions">Onions</option>
</select>
</td>
<td>
The buttin will keep the <code>tabindex</code> of the select.
</td>
</tr>
</table> </table>
<div class="page-header"> <div class="page-header">
<h1>Code</h1> <h1>Code</h1>
......
...@@ -41,12 +41,19 @@ ...@@ -41,12 +41,19 @@
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>') 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="multiselect-container dropdown-menu' + (this.options.dropRight ? ' pull-right' : '') + '"></ul>'); .append('<ul class="multiselect-container dropdown-menu' + (this.options.dropRight ? ' pull-right' : '') + '"></ul>');
// Manually add button width if set.
if (this.options.buttonWidth) { if (this.options.buttonWidth) {
$('button', this.$container).css({ $('button', this.$container).css({
'width' : this.options.buttonWidth 'width' : this.options.buttonWidth
}); });
} }
// Keep the tab index from the select.
var tabindex = this.$select.attr('tabindex');
if (tabindex) {
$('button', this.$container).attr('tabindex', tabindex);
}
// Set max height of dropdown menu to activate auto scrollbar. // Set max height of dropdown menu to activate auto scrollbar.
if (this.options.maxHeight) { if (this.options.maxHeight) {
// TODO: Add a class for this option to move the css declarations. // TODO: Add a class for this option to move the css declarations.
......
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