diff options
author | Tomasz Knyziak <t.knyziak@gmail.com> | 2014-11-09 09:11:09 +0100 |
---|---|---|
committer | Tomasz Knyziak <t.knyziak@gmail.com> | 2014-11-09 09:11:09 +0100 |
commit | fae1b8cdeaad783d2ff22ecdbb595b5d215b86fb (patch) | |
tree | 758b400b3c11b454444ab87eadb8ab687431d37a /jquery.multiple.select.js | |
parent | a7473b5a2dc6a46abf8c09f84b8736d446610d3c (diff) | |
download | multiple-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.js | 5 |
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) { |