Commit 5db0b473 authored by davidstutz's avatar davidstutz

#539, #531 example and code update.

parent 861bddce
...@@ -211,9 +211,11 @@ ...@@ -211,9 +211,11 @@
} }
else { else {
var selected = ''; var selected = '';
var delimiter = this.delimiterText;
options.each(function() { options.each(function() {
var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text(); var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text();
selected += label + ', '; selected += label + delimiter;
}); });
return selected.substr(0, selected.length - 2); return selected.substr(0, selected.length - 2);
...@@ -232,10 +234,11 @@ ...@@ -232,10 +234,11 @@
} }
else { else {
var selected = ''; var selected = '';
var delimiter = this.delimiter; var delimiter = this.delimiterText;
options.each(function () { options.each(function () {
var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text(); var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text();
selected += label + ', '; selected += label + delimiter;
}); });
return selected.substr(0, selected.length - 2); return selected.substr(0, selected.length - 2);
} }
...@@ -328,7 +331,7 @@ ...@@ -328,7 +331,7 @@
allSelectedText: 'All selected', allSelectedText: 'All selected',
numberDisplayed: 3, numberDisplayed: 3,
disableIfEmpty: false, disableIfEmpty: false,
delimiter: ', ', delimiterText: ', ',
templates: { templates: {
button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>', button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>',
ul: '<ul class="multiselect-container dropdown-menu"></ul>', ul: '<ul class="multiselect-container dropdown-menu"></ul>',
......
...@@ -454,37 +454,6 @@ ...@@ -454,37 +454,6 @@
</pre> </pre>
</td> </td>
</tr> </tr>
<tr>
<td><code>delimiter</code></td>
<td>
<p>
Sets the separator for the list of selected items for mouse-over. Defaults to ', '. Set to '\n' for a neater display.
</p>
<div class="example">
<script type="text/javascript">
$(document).ready(function() {
$('#example-delimiter').multiselect({
delimiter: '\n'
});
});
</script>
<select id="example-delimiter" multiple="multiple"></select>
</div>
<div class="highlight">
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$('#example-delimiter').multiselect({
delimiter: '\n'
});
});
&lt;/script&gt;
</pre>
</div>
</td>
</tr>
<tr> <tr>
<td><code>disableIfEmpty</code></td> <td><code>disableIfEmpty</code></td>
<td> <td>
...@@ -1388,6 +1357,43 @@ ...@@ -1388,6 +1357,43 @@
}); });
}); });
&lt;/script&gt; &lt;/script&gt;
</pre>
</div>
</td>
</tr>
<tr>
<td><code>delimiterText</code></td>
<td>
<p>
Sets the separator for the list of selected items for mouse-over. Defaults to ', '. Set to '\n' for a neater display.
</p>
<div class="example">
<script type="text/javascript">
$(document).ready(function() {
$('#example-delimiterText').multiselect({
delimiterText: '; '
});
});
</script>
<select id="example-delimiterText" multiple="multiple">
<option value="1">Option 1</option>
<option value="2" selected="selected">Option 2</option>
<option value="3" selected="selected">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
</select>
</div>
<div class="highlight">
<pre class="prettyprint linenums">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
$('#example-delimiterText').multiselect({
delimiterText '; '
});
});
&lt;/script&gt;
</pre> </pre>
</div> </div>
</td> </td>
......
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