summaryrefslogtreecommitdiffstats
path: root/js/jquery.multi-select.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r--js/jquery.multi-select.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index 86d949b..1e24760 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -64,10 +64,16 @@
</li>');
optgroupCpt++;
} else {
- var klass = $(this).attr('class') ? $(this).attr('class') : '',
- title = $(this).attr('title') ? $(this).attr('title') : '',
- value = $(this).val(),
- selectableLi = $('<li class="'+klass+'" ms-value="'+value+'" title="'+title+'"><div>'+$(this).text()+'</div></li>'),
+
+ var attributes = "";
+
+ for (var cpt = 0; cpt < this.attributes.length; cpt++){
+ var attr = this.attributes[cpt],
+ name = (attr.name == 'value') ? 'ms-value' : attr.name;
+
+ attributes += name+'="'+attr.value+'" ';
+ }
+ var selectableLi = $('<li '+attributes+'><div>'+$(this).text()+'</div></li>'),
selectedLi = selectableLi.clone();
selectableLi.addClass('ms-elem-selectable');