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:
commit
f272ac9f80
@ -980,7 +980,8 @@
|
|||||||
this.close();
|
this.close();
|
||||||
this.container.removeClass("select2-container-active");
|
this.container.removeClass("select2-container-active");
|
||||||
this.dropdown.removeClass("select2-drop-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.clearSearch();
|
||||||
this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
|
this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
|
||||||
},
|
},
|
||||||
@ -1082,7 +1083,7 @@
|
|||||||
|
|
||||||
// single
|
// single
|
||||||
isFocused: function () {
|
isFocused: function () {
|
||||||
return this.selection.is(":focus");
|
return this.selection[0] === document.activeElement;
|
||||||
},
|
},
|
||||||
|
|
||||||
// single
|
// single
|
||||||
|
Loading…
Reference in New Issue
Block a user