1
0
mirror of synced 2024-11-25 14:26:03 +03:00

Merge pull request #186 from nutshellcrm/focus-syntax-error-1.6

Fixes syntax error in jQuery < 1.6 (":focus" selector is unavailable)
This commit is contained in:
Igor Vaynberg 2012-07-04 21:50:04 -07:00
commit f272ac9f80

View File

@ -980,7 +980,8 @@
this.close();
this.container.removeClass("select2-container-active");
this.dropdown.removeClass("select2-drop-active");
if (this.search.is(":focus")) { this.search.blur(); }
// synonymous to .is(':focus'), which is available in jquery >= 1.6
if (this.search[0] === document.activeElement) { this.search.blur(); }
this.clearSearch();
this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
},
@ -1082,7 +1083,7 @@
// single
isFocused: function () {
return this.selection.is(":focus");
return this.selection[0] === document.activeElement;
},
// single