Commit 8ce41b52 authored by David Stutz's avatar David Stutz

Merge pull request #46 from emergence/master

Add the ability for drop down menus to pull-right.
parents d0f40bc4 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:
......
......@@ -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>&lt;option label=&quot;label&quot;&gt;&lt;/option&gt;</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>
......@@ -1107,4 +1127,4 @@
</p>
</div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -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" />',
......
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