summaryrefslogtreecommitdiffstats
path: root/jquery.multiple.select.js
diff options
context:
space:
mode:
authorTomasz Knyziak <t.knyziak@gmail.com>2014-11-09 09:11:09 +0100
committerTomasz Knyziak <t.knyziak@gmail.com>2014-11-09 09:11:09 +0100
commitfae1b8cdeaad783d2ff22ecdbb595b5d215b86fb (patch)
tree758b400b3c11b454444ab87eadb8ab687431d37a /jquery.multiple.select.js
parenta7473b5a2dc6a46abf8c09f84b8736d446610d3c (diff)
downloadmultiple-select-fae1b8cdeaad783d2ff22ecdbb595b5d215b86fb.zip
multiple-select-fae1b8cdeaad783d2ff22ecdbb595b5d215b86fb.tar.gz
multiple-select-fae1b8cdeaad783d2ff22ecdbb595b5d215b86fb.tar.bz2
Fixed the error when element id's contain colons.
Diffstat (limited to 'jquery.multiple.select.js')
-rw-r--r--jquery.multiple.select.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/jquery.multiple.select.js b/jquery.multiple.select.js
index 03db7db..4952843 100644
--- a/jquery.multiple.select.js
+++ b/jquery.multiple.select.js
@@ -178,7 +178,10 @@
that[that.options.isOpen ? 'close' : 'open']();
}
- var label = this.$el.parent().closest('label')[0] || $('label[for=' + this.$el.attr('id') + ']')[0];
+ var escapedId = this.$el.attr('id').split(':').join('\\:');
+
+ var label = this.$el.parent().closest('label')[0] || $('label[for=' + escapedId + ']')[0];
+
if (label) {
$(label).off('click').on('click', function (e) {
if (e.target.nodeName.toLowerCase() !== 'label' || e.target !== this) {