mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
better scroll/touch handling on mobiles
This commit is contained in:
parent
b3454b535f
commit
33c1ce8d55
@ -239,9 +239,8 @@ export default Ember.Component.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_bindEmojiClick($emojisContainer) {
|
_bindEmojiClick($emojisContainer) {
|
||||||
// $emojisContainer.off("click", "a");
|
let handler = (event) => {
|
||||||
$emojisContainer.on("click", "a", e => {
|
const code = this._codeForEmojiLink($(event.currentTarget));
|
||||||
const code = this._codeForEmojiLink($(e.currentTarget));
|
|
||||||
|
|
||||||
this._trackEmojiUsage(code);
|
this._trackEmojiUsage(code);
|
||||||
this.sendAction("emojiSelected", code);
|
this.sendAction("emojiSelected", code);
|
||||||
@ -251,7 +250,24 @@ export default Ember.Component.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if(this.site.isMobileDevice) {
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
$emojisContainer
|
||||||
|
.off("touchstart")
|
||||||
|
.on("touchstart", "a", (touchStartEvent) => {
|
||||||
|
const $this = $(touchStartEvent.currentTarget);
|
||||||
|
$this.on('touchend', (touchEndEvent) => {
|
||||||
|
handler.bind(self)(touchEndEvent);
|
||||||
|
$this.off('touchend');
|
||||||
});
|
});
|
||||||
|
$this.on('touchmove', () => $this.off('touchend') );
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$emojisContainer.on("click", "a", e => handler.bind(this)(e) );
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_bindSectionsScroll() {
|
_bindSectionsScroll() {
|
||||||
|
Loading…
Reference in New Issue
Block a user