Stop duplicate context menus on tracking history long-press
This commit is contained in:
parent
2167d7c206
commit
e4377564d6
@ -272,6 +272,11 @@ $("#app").on("submit", "#tracking-searchbar-form", function (evt) {
|
||||
$("#app").on("contextmenu taphold", ".tracking-code-history-link", function (evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
// Don't trigger contextmenu on a touch device because we'll also get a taphold
|
||||
if (evt.type == "contextmenu" && window.matchMedia("(pointer: coarse)").matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
var code = $(this).data("trackingcode");
|
||||
|
||||
var action = app.actions.create({
|
||||
@ -315,6 +320,11 @@ $("#app").on("contextmenu taphold", ".tracking-code-history-link", function (evt
|
||||
$("#app").on("contextmenu taphold", ".tracking-code-multi-link", function (evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
// Don't trigger contextmenu on a touch device because we'll also get a taphold
|
||||
if (evt.type == "contextmenu" && window.matchMedia("(pointer: coarse)").matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
var code = $(this).data("trackingcode");
|
||||
|
||||
var action = app.actions.create({
|
||||
@ -362,6 +372,11 @@ $("#app").on("contextmenu taphold", ".tracking-code-multi-link", function (evt)
|
||||
$("#app").on("contextmenu taphold", "#brokenscannercodeadd", function (evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
// Don't trigger contextmenu on a touch device because we'll also get a taphold
|
||||
if (evt.type == "contextmenu" && window.matchMedia("(pointer: coarse)").matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
var code = $('input[name=\'trackingcode\']').val().trim().replace(/\s/, "");
|
||||
|
||||
var action = app.actions.create({
|
||||
|
Loading…
x
Reference in New Issue
Block a user