mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:00:49 +08:00
FIX: pikaday wasn't working when using the mouse with a touch-enabled monitor
This commit is contained in:
@ -428,7 +428,6 @@
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if (hasClass(target, 'pika-prev')) {
|
||||
self.prevMonth();
|
||||
@ -438,6 +437,7 @@
|
||||
}
|
||||
}
|
||||
if (!hasClass(target, 'pika-select')) {
|
||||
// if this is touch event prevent mouse events emulation
|
||||
if (e.preventDefault) {
|
||||
e.preventDefault();
|
||||
} else {
|
||||
@ -543,7 +543,8 @@
|
||||
self.el = document.createElement('div');
|
||||
self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');
|
||||
|
||||
addEvent(self.el, 'ontouchend' in document ? 'touchend' : 'mousedown', self._onMouseDown, true);
|
||||
addEvent(self.el, 'mousedown', self._onMouseDown, true);
|
||||
addEvent(self.el, 'touchend', self._onMouseDown, true);
|
||||
addEvent(self.el, 'change', self._onChange);
|
||||
|
||||
if (opts.field) {
|
||||
@ -1058,6 +1059,7 @@
|
||||
{
|
||||
this.hide();
|
||||
removeEvent(this.el, 'mousedown', this._onMouseDown, true);
|
||||
removeEvent(this.el, 'touchend', this._onMouseDown, true);
|
||||
removeEvent(this.el, 'change', this._onChange);
|
||||
if (this._o.field) {
|
||||
removeEvent(this._o.field, 'change', this._onInputChange);
|
||||
|
Reference in New Issue
Block a user