Let's be honest: we skip focus for iOS, not touch in general.
This commit is contained in:
parent
76692235ae
commit
5a15c4997c
|
@ -72,7 +72,7 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
const $elem = this.$();
|
const $elem = this.$();
|
||||||
const minimumResultsForSearch = this.capabilities.touch ? -1 : 5;
|
const minimumResultsForSearch = this.capabilities.isIOS ? -1 : 5;
|
||||||
$elem.select2({formatResult: this.comboTemplate, minimumResultsForSearch, width: 'resolve'});
|
$elem.select2({formatResult: this.comboTemplate, minimumResultsForSearch, width: 'resolve'});
|
||||||
|
|
||||||
const castInteger = this.get('castInteger');
|
const castInteger = this.get('castInteger');
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default Ember.Component.extend({
|
||||||
$input.on('scroll', () => Ember.run.throttle(this, this._syncEditorAndPreviewScroll, 20));
|
$input.on('scroll', () => Ember.run.throttle(this, this._syncEditorAndPreviewScroll, 20));
|
||||||
|
|
||||||
// Focus on the body unless we have a title
|
// Focus on the body unless we have a title
|
||||||
if (!this.get('composer.canEditTitle') && !this.capabilities.touch) {
|
if (!this.get('composer.canEditTitle') && !this.capabilities.isIOS) {
|
||||||
this.$('.d-editor-input').putCursorAtEnd();
|
this.$('.d-editor-input').putCursorAtEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
@on('didInsertElement')
|
@on('didInsertElement')
|
||||||
_focusOnTitle() {
|
_focusOnTitle() {
|
||||||
if (!this.capabilities.touch) {
|
if (!this.capabilities.isIOS) {
|
||||||
this.$('input').putCursorAtEnd();
|
this.$('input').putCursorAtEnd();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -100,7 +100,7 @@ export default Ember.Component.extend({
|
||||||
this._watchSizeChanges();
|
this._watchSizeChanges();
|
||||||
|
|
||||||
// iOS does not handle scroll events well
|
// iOS does not handle scroll events well
|
||||||
if (!this.capabilities.touch) {
|
if (!this.capabilities.isIOS) {
|
||||||
$(window).on('scroll.discourse-menu-panel', () => this.performLayout());
|
$(window).on('scroll.discourse-menu-panel', () => this.performLayout());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -24,6 +24,8 @@ export default {
|
||||||
caps.isChrome = !!window.chrome && !caps.isOpera;
|
caps.isChrome = !!window.chrome && !caps.isOpera;
|
||||||
caps.canPasteImages = caps.isChrome || caps.isFirefox;
|
caps.canPasteImages = caps.isChrome || caps.isFirefox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
caps.isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We consider high res a device with 1280 horizontal pixels. High DPI tablets like
|
// We consider high res a device with 1280 horizontal pixels. High DPI tablets like
|
||||||
|
|
|
@ -76,7 +76,7 @@ export default Ember.View.extend({
|
||||||
_focusWhenOpened: function() {
|
_focusWhenOpened: function() {
|
||||||
|
|
||||||
// Don't focus on mobile or touch
|
// Don't focus on mobile or touch
|
||||||
if (Discourse.Mobile.mobileView || this.capabilities.touch) {
|
if (Discourse.Mobile.mobileView || this.capabilities.isIOS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue