Merge pull request #3186 from colemanw/offFocus
Ensure focus event is unbound after widget is destroyed
This commit is contained in:
commit
2eea4a486a
@ -2132,7 +2132,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.focusser.attr("id", "s2id_autogen"+idSuffix);
|
this.focusser.attr("id", "s2id_autogen"+idSuffix);
|
||||||
|
|
||||||
elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
|
elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
|
||||||
this.opts.element.focus(this.bind(function () { this.focus(); }));
|
this.opts.element.on('focus.select2', this.bind(function () { this.focus(); }));
|
||||||
|
|
||||||
this.focusser.prev()
|
this.focusser.prev()
|
||||||
.text(elementLabel.text())
|
.text(elementLabel.text())
|
||||||
@ -2727,7 +2727,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.search.prev()
|
this.search.prev()
|
||||||
.text($("label[for='" + this.opts.element.attr("id") + "']").text())
|
.text($("label[for='" + this.opts.element.attr("id") + "']").text())
|
||||||
.attr('for', this.search.attr('id'));
|
.attr('for', this.search.attr('id'));
|
||||||
this.opts.element.focus(this.bind(function () { this.focus(); }));
|
this.opts.element.on('focus.select2', this.bind(function () { this.focus(); }));
|
||||||
|
|
||||||
this.search.on("input paste", this.bind(function() {
|
this.search.on("input paste", this.bind(function() {
|
||||||
if (this.search.attr('placeholder') && this.search.val().length == 0) return;
|
if (this.search.attr('placeholder') && this.search.val().length == 0) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user