mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07:00
Add WebUI support for triggering context menus on mobile
This commit is contained in:
parent
f441d561a2
commit
6af01cfcbe
2 changed files with 24 additions and 1 deletions
|
@ -46,7 +46,8 @@ var ContextMenu = new Class({
|
||||||
onShow: $empty,
|
onShow: $empty,
|
||||||
onHide: $empty,
|
onHide: $empty,
|
||||||
onClick: $empty,
|
onClick: $empty,
|
||||||
fadeSpeed: 200
|
fadeSpeed: 200,
|
||||||
|
touchTimer: 600
|
||||||
},
|
},
|
||||||
|
|
||||||
//initialization
|
//initialization
|
||||||
|
@ -148,6 +149,21 @@ var ContextMenu = new Class({
|
||||||
elem.addEvent('click', function(e) {
|
elem.addEvent('click', function(e) {
|
||||||
this.hide();
|
this.hide();
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
elem.addEvent('touchstart', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
clearTimeout(this.touchstartTimer);
|
||||||
|
this.hide();
|
||||||
|
|
||||||
|
const touchstartEvent = e;
|
||||||
|
this.touchstartTimer = setTimeout(function() {
|
||||||
|
this.triggerMenu(touchstartEvent, elem);
|
||||||
|
}.bind(this), this.options.touchTimer);
|
||||||
|
}.bind(this));
|
||||||
|
elem.addEvent('touchend', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
clearTimeout(this.touchstartTimer);
|
||||||
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
addTarget: function(t) {
|
addTarget: function(t) {
|
||||||
|
|
|
@ -706,6 +706,13 @@ var DynamicTable = new Class({
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
tr.addEvent('touchstart', function(e) {
|
||||||
|
if (!this._this.isRowSelected(this.rowId)) {
|
||||||
|
this._this.deselectAll();
|
||||||
|
this._this.selectRow(this.rowId);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
this.setupTr(tr);
|
this.setupTr(tr);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue