Commit 1b3a01d1 authored by David Stutz's avatar David Stutz

#181

parent 9c44c2a0
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1284,6 +1284,31 @@ $("#multiselect").multiselect('dataprovider', data);
var orderCount = 0;
$('#example38').multiselect({
buttonText: function(options) {
if (options.length == 0) {
return 'None selected <b class="caret"></b>';
}
else if (options.length > 3) {
return options.length + ' selected <b class="caret"></b>';
}
else {
var selected = [];
options.each(function() {
selected.push([$(this).text(), $(this).data('order')]);
});
;
selected.sort(function(a, b) {
return a[1] - b[1];
})
var text = '';
for (var i = 0; i < selected.length; i++) {
text += selected[i][0] + ', ';
}
return text.substr(0, text.length -2) + ' <b class="caret"></b>';
}
},
onChange: function(option, checked) {
if (checked) {
orderCount++;
......@@ -1638,6 +1663,31 @@ $(&quot;#multiselect&quot;).multiselect('dataprovider', data);
$(document).ready(function() {
var orderCount = 0;
$('#example38').multiselect({
buttonText: function(options) {
if (options.length == 0) {
return 'None selected <b class="caret"></b>';
}
else if (options.length > 3) {
return options.length + ' selected <b class="caret"></b>';
}
else {
var selected = [];
options.each(function() {
selected.push([$(this).text(), $(this).data('order')]);
});
selected.sort(function(a, b) {
return a[1] - b[1];
})
var text = '';
for (var i = 0; i < selected.length; i++) {
text += selected[i][0] + ', ';
}
return text.substr(0, text.length -2) + ' <b class="caret"></b>';
}
},
onChange: function(option, checked) {
if (checked) {
orderCount++;
......
......@@ -272,9 +272,9 @@
$option.prop('selected', false);
}
this.updateButtonText();
this.$select.change();
this.options.onChange($option, checked);
this.updateButtonText();
if(this.options.preventInputChangeEvent) {
return false;
......
......@@ -44,7 +44,7 @@
@font-family-monospace: Monaco, Menlo, Consolas, "Courier New", monospace;
@font-family-base: @font-family-sans-serif;
@font-size-base: 14px;
@font-size-base: 15px;
@font-size-large: ceil(@font-size-base * 1.25); // ~18px
@font-size-small: ceil(@font-size-base * 0.85); // ~12px
......
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