Commit ad7e1b5a authored by David Stutz's avatar David Stutz

Merge pull request #250 from elasticsales/includeSelectAllDivider

includeSelectAllDivider option including documentation.
parents 6dc16da0 48d2aa74
......@@ -800,6 +800,24 @@
includeSelectAllOption: true
});
});
</script>
</pre>
</td>
</tr>
<tr>
<td><code>includeSelectAllDivider</code></td>
<td>
If set to <code>true</code> (along with <code>includeSelectAllOption</code>) a divider will be placed below the 'Select all' option.
</td>
<td>
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$(&#39;.multiselect&#39;).multiselect({
includeSelectAllOption: true,
includeSelectAllDivider: true
});
});
&lt;/script&gt;
</pre>
</td>
......
......@@ -575,6 +575,9 @@
// If options.includeSelectAllOption === true, add the include all checkbox.
if (this.options.includeSelectAllOption && this.options.multiple && !alreadyHasSelectAll) {
if (this.options.includeSelectAllDivider) {
this.$select.prepend('<option value="" disabled="disabled" data-role="divider">');
}
this.$select.prepend('<option value="' + this.options.selectAllValue + '">' + this.options.selectAllText + '</option>');
}
},
......
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