FIX: avoid touch on select-kit causing instant closing of it

This commit is contained in:
Joffrey JAFFEUX 2017-11-22 16:36:50 +01:00 committed by GitHub
parent 8a7cbeef00
commit d32c95b6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -46,7 +46,9 @@ export default Ember.Mixin.create({
@on("didInsertElement")
_setupResizeListener() {
if (!(this.site && this.site.isMobileDevice)) {
$(window).on("resize.select-kit", () => this.collapse() );
}
},
@on("willDestroyElement")
@ -69,10 +71,10 @@ export default Ember.Mixin.create({
// try to focus filter and fallback to header if not present
focusFilterOrHeader() {
Ember.run.schedule("afterRender", () => {
if (this.$filterInput().is(":visible")) {
this.$filterInput().focus();
} else {
if ((this.site && this.site.isMobileDevice) || !this.$filterInput().is(":visible")) {
this.$header().focus();
} else {
this.$filterInput().focus();
}
});
},