Permalink
Browse files

Merge pull request #346 from Polonious/master

Escapes special characters in containerId selector
  • Loading branch information...
2 parents 64ec0c5 + 02d6f9f commit b5cceab21e532ad21a22a2ce7bda3c8c2f713391 @ivaynberg ivaynberg committed Aug 18, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 select2.js
View
@@ -560,6 +560,7 @@
this.container = this.createContainer();
this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
+ this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
this.container.attr("id", this.containerId);
// cache the body so future lookups are cheap
@@ -942,7 +943,7 @@
*/
// abstract
opening: function() {
- var cid = this.containerId, selector = "#"+ cid,
+ var cid = this.containerId, selector = this.containerSelector,
scroll = "scroll." + cid, resize = "resize." + cid;
this.container.parents().each(function() {

0 comments on commit b5cceab

Please sign in to comment.