1
0
mirror of synced 2024-11-22 13:06:08 +03:00

Merge pull request #2324 from tunguski/master

Fix for dots in id
This commit is contained in:
Kevin Brown 2014-04-28 12:32:08 -04:00
commit 00a019b227

View File

@ -684,8 +684,10 @@ the specific language governing permissions and limitations under the Apache Lic
.addClass("select2-hidden-accessible")
.appendTo(document.body);
this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()).replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
this.containerSelector="#"+this.containerId;
this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
this.containerEventName= this.containerId
.replace(/([.])/g, '_')
.replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
this.container.attr("id", this.containerId);
this.container.attr("title", opts.element.attr("title"));
@ -1335,7 +1337,7 @@ the specific language governing permissions and limitations under the Apache Lic
*/
// abstract
opening: function() {
var cid = this.containerId,
var cid = this.containerEventName,
scroll = "scroll." + cid,
resize = "resize."+cid,
orient = "orientationchange."+cid,
@ -1407,7 +1409,7 @@ the specific language governing permissions and limitations under the Apache Lic
close: function () {
if (!this.opened()) return;
var cid = this.containerId,
var cid = this.containerEventName,
scroll = "scroll." + cid,
resize = "resize."+cid,
orient = "orientationchange."+cid;