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

label for support for id's with brackets, eg id='name[first]'. fixes #422

This commit is contained in:
Igor Vaynberg 2012-09-17 18:43:26 -07:00
parent 7ee6446bc5
commit f7e78f6ed9

View File

@ -517,6 +517,7 @@
target=$(e.target);
attr = target.attr("for");
if ("LABEL" === e.target.tagName && attr && attr.length > 0) {
attr = attr.replace(/([\[\].])/g,'\\$1'); /* escapes [, ], and . so properly selects the id */
target = $("#"+attr);
target = target.data("select2");
if (target !== undefined) { target.focus(); e.preventDefault();}