DEV: should check on object and not length (#7742)

This commit is contained in:
Joffrey JAFFEUX 2019-06-11 09:45:45 +02:00 committed by GitHub
parent e5cace9185
commit c407e32368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,7 @@ export default Ember.Mixin.create({
_cleanUpEvents() {
$(document).off("mousedown.select-kit", this._boundMouseDownHandler);
if (this.$header().length) {
if (this.$header()) {
this.$header()
.off("blur.select-kit", this._boundBlurHeaderHandler)
.off("focus.select-kit", this._boundFocusHeaderHandler)
@ -68,7 +68,7 @@ export default Ember.Mixin.create({
.off("keypress.select-kit", this._boundKeypressHeaderHandler);
}
if (this.$filterInput().length) {
if (this.$filterInput()) {
this.$filterInput()
.off("change.select-kit", this._boundChangeFilterInputHandler)
.off("keypress.select-kit", this._boundKeypressFilterInputHandler)