summaryrefslogtreecommitdiffstats
path: root/js/jquery.multi-select.js
diff options
context:
space:
mode:
authorlou <louiscuny@gmail.com>2011-05-03 23:36:09 +0200
committerlou <louiscuny@gmail.com>2011-05-03 23:36:09 +0200
commit7d3d5c39adc1f88ca79b78cf008ad2f015096849 (patch)
tree4e8c61a83af40d20c63a5594c7714728420c68f3 /js/jquery.multi-select.js
parenta5535db7e6ce9f71c6534420cfa799792b0ae14b (diff)
downloadmulti-select-7d3d5c39adc1f88ca79b78cf008ad2f015096849.zip
multi-select-7d3d5c39adc1f88ca79b78cf008ad2f015096849.tar.gz
multi-select-7d3d5c39adc1f88ca79b78cf008ad2f015096849.tar.bz2
generate select id if none
Diffstat (limited to 'js/jquery.multi-select.js')
-rw-r--r--js/jquery.multi-select.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index 8090cd5..39759f9 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -12,8 +12,10 @@
multiSelects.hide();
multiSelects.each(function(){
- var ms = $(this),
- container = $('<div id="ms-'+ms.attr('id')+'" class="ms-container"></div>').detach(),
+
+ var ms = $(this);
+ var msId = ms.attr('id') != undefined ? ms.attr('id') : 'select'+((new Date()).getTime());
+ var container = $('<div id="ms-'+msId+'" class="ms-container"></div>').detach(),
selectableContainer = $('<div class="ms-selectable"></div>').detach(),
selectedContainer = $('<div class="ms-selection"></div>').detach(),
selectableUl = $('<ul></ul>').detach(),