mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "FIX: various select-kit corrections on mobile"
This reverts commit 78a2324c89.
This commit is contained in:
@@ -92,6 +92,17 @@ export default Ember.Component.extend(
|
||||
this.set("computedContent", []);
|
||||
this.set("highlightedSelection", []);
|
||||
|
||||
if (this.site && this.site.isMobileDevice) {
|
||||
this.setProperties({
|
||||
filterable: isNone(this.get("filterable"))
|
||||
? false
|
||||
: this.get("filterable"),
|
||||
autoFilterable: isNone(this.get("autoFilterable"))
|
||||
? false
|
||||
: this.get("filterable")
|
||||
});
|
||||
}
|
||||
|
||||
if (this.get("nameChanges")) {
|
||||
this.addObserver(
|
||||
`content.@each.${this.get("nameProperty")}`,
|
||||
|
||||
@@ -82,10 +82,8 @@ export default Ember.Mixin.create({
|
||||
},
|
||||
|
||||
focus() {
|
||||
Ember.run.next(() => {
|
||||
Ember.run.schedule("afterRender", () => {
|
||||
this.$filterInput().focus();
|
||||
});
|
||||
Ember.run.schedule("afterRender", () => {
|
||||
this.$header().focus();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -95,7 +93,11 @@ export default Ember.Mixin.create({
|
||||
// next so we are sure it finised expand/collapse
|
||||
Ember.run.next(() => {
|
||||
Ember.run.schedule("afterRender", () => {
|
||||
if (!context.$filterInput() || !context.$filterInput().is(":visible")) {
|
||||
if (
|
||||
(this.site && this.site.isMobileDevice) ||
|
||||
!context.$filterInput() ||
|
||||
!context.$filterInput().is(":visible")
|
||||
) {
|
||||
context.$header().focus();
|
||||
} else {
|
||||
context.$filterInput().focus();
|
||||
|
||||
@@ -16,11 +16,11 @@ export default Ember.Mixin.create({
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
this._super();
|
||||
|
||||
$(document).off("mousedown.select-kit");
|
||||
|
||||
if (this.$header().length) {
|
||||
if (this.$header()) {
|
||||
this.$header()
|
||||
.off("blur.select-kit")
|
||||
.off("focus.select-kit")
|
||||
@@ -28,7 +28,7 @@ export default Ember.Mixin.create({
|
||||
.off("keydown.select-kit");
|
||||
}
|
||||
|
||||
if (this.$filterInput().length) {
|
||||
if (this.$filterInput()) {
|
||||
this.$filterInput()
|
||||
.off("change.select-kit")
|
||||
.off("keydown.select-kit")
|
||||
@@ -37,7 +37,7 @@ export default Ember.Mixin.create({
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
this._super();
|
||||
|
||||
$(document).on("mousedown.select-kit", event => {
|
||||
if (!this.element || this.isDestroying || this.isDestroyed) {
|
||||
|
||||
Reference in New Issue
Block a user