|
@@ -380,6 +380,8 @@
|
|
|
|
|
|
/**
|
|
/**
|
|
* blurs any Select2 container that has focus when an element outside them was clicked or received focus
|
|
* blurs any Select2 container that has focus when an element outside them was clicked or received focus
|
|
|
|
+ *
|
|
|
|
+ * also takes care of clicks on label tags that point to the source element
|
|
*/
|
|
*/
|
|
$(document).ready(function () {
|
|
$(document).ready(function () {
|
|
$(document).delegate("*", "mousedown touchend", function (e) {
|
|
$(document).delegate("*", "mousedown touchend", function (e) {
|
|
@@ -394,6 +396,13 @@
|
|
if (this !== target) $(this).data("select2").blur();
|
|
if (this !== target) $(this).data("select2").blur();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ target=$(e.target);
|
|
|
|
+ if ("LABEL" === e.target.tagName && target.attr("for").length > 0) {
|
|
|
|
+ target = $("#"+target.attr("for"));
|
|
|
|
+ target = target.data("select2");
|
|
|
|
+ if (target !== undefined) { target.focus(); e.preventDefault();}
|
|
|
|
+ }
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|