Kaynağa Gözat

Fixed string used as regular expression for ID attribute.

Signed-off-by: Igor Vaynberg <[email protected]>
Lito 11 yıl önce
ebeveyn
işleme
abe7777b0a
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      select2.js

+ 2 - 2
select2.js

@@ -669,8 +669,8 @@ the specific language governing permissions and limitations under the Apache Lic
 
             this.container = this.createContainer();
 
-            this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
-            this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
+            this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()).replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
+            this.containerSelector="#"+this.containerId;
             this.container.attr("id", this.containerId);
 
             // cache the body so future lookups are cheap