mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 18:36:38 -06:00
fixes positioning of the context menu
This commit is contained in:
parent
a13cf0733b
commit
99a34a888e
@ -261,17 +261,17 @@ function showGarageContextMenu(e) {
|
|||||||
if (getDeviceIsTouchOnly()) {
|
if (getDeviceIsTouchOnly()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$(".garage-context-menu").fadeIn("fast");
|
|
||||||
$(".garage-context-menu").css({
|
|
||||||
left: getGarageMenuPosition(event.clientX, 'width', 'scrollLeft'),
|
|
||||||
top: getGarageMenuPosition(event.clientY, 'height', 'scrollTop')
|
|
||||||
});
|
|
||||||
if (!$(e).hasClass('garage-active')) {
|
if (!$(e).hasClass('garage-active')) {
|
||||||
clearSelectedVehicles();
|
clearSelectedVehicles();
|
||||||
addToSelectedVehicles($(e).attr('data-rowId'));
|
addToSelectedVehicles($(e).attr('data-rowId'));
|
||||||
$(e).addClass('garage-active');
|
$(e).addClass('garage-active');
|
||||||
}
|
}
|
||||||
|
$(".garage-context-menu").fadeIn("fast");
|
||||||
determineGarageContextMenu();
|
determineGarageContextMenu();
|
||||||
|
$(".garage-context-menu").css({
|
||||||
|
left: getGarageMenuPosition(event.clientX, 'width', 'scrollLeft'),
|
||||||
|
top: getGarageMenuPosition(event.clientY, 'height', 'scrollTop')
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function showGarageContextMenuForMobile(e, xPosition, yPosition) {
|
function showGarageContextMenuForMobile(e, xPosition, yPosition) {
|
||||||
if (!$(e).hasClass('garage-active')) {
|
if (!$(e).hasClass('garage-active')) {
|
||||||
@ -279,11 +279,11 @@ function showGarageContextMenuForMobile(e, xPosition, yPosition) {
|
|||||||
$(e).addClass('garage-active');
|
$(e).addClass('garage-active');
|
||||||
} else {
|
} else {
|
||||||
$(".garage-context-menu").fadeIn("fast");
|
$(".garage-context-menu").fadeIn("fast");
|
||||||
|
determineGarageContextMenu();
|
||||||
$(".garage-context-menu").css({
|
$(".garage-context-menu").css({
|
||||||
left: getGarageMenuPosition(xPosition, 'width', 'scrollLeft'),
|
left: getGarageMenuPosition(xPosition, 'width', 'scrollLeft'),
|
||||||
top: getGarageMenuPosition(yPosition, 'height', 'scrollTop')
|
top: getGarageMenuPosition(yPosition, 'height', 'scrollTop')
|
||||||
});
|
});
|
||||||
determineGarageContextMenu();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function determineGarageContextMenu() {
|
function determineGarageContextMenu() {
|
||||||
|
|||||||
@ -1262,17 +1262,17 @@ function showTableContextMenu(e) {
|
|||||||
if (getDeviceIsTouchOnly()) {
|
if (getDeviceIsTouchOnly()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$(".table-context-menu").fadeIn("fast");
|
|
||||||
$(".table-context-menu").css({
|
|
||||||
left: getMenuPosition(event.clientX, 'width', 'scrollLeft'),
|
|
||||||
top: getMenuPosition(event.clientY, 'height', 'scrollTop')
|
|
||||||
});
|
|
||||||
if (!$(e).hasClass('table-active')) {
|
if (!$(e).hasClass('table-active')) {
|
||||||
clearSelectedRows();
|
clearSelectedRows();
|
||||||
addToSelectedRows($(e).attr('data-rowId'));
|
addToSelectedRows($(e).attr('data-rowId'));
|
||||||
$(e).addClass('table-active');
|
$(e).addClass('table-active');
|
||||||
}
|
}
|
||||||
|
$(".table-context-menu").fadeIn("fast");
|
||||||
determineContextMenuItems();
|
determineContextMenuItems();
|
||||||
|
$(".table-context-menu").css({
|
||||||
|
left: getMenuPosition(event.clientX, 'width', 'scrollLeft'),
|
||||||
|
top: getMenuPosition(event.clientY, 'height', 'scrollTop')
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function determineContextMenuItems() {
|
function determineContextMenuItems() {
|
||||||
var tableRows = $('.table tbody tr:visible');
|
var tableRows = $('.table tbody tr:visible');
|
||||||
@ -1352,11 +1352,11 @@ function showTableContextMenuForMobile(e, xPosition, yPosition) {
|
|||||||
shakeTableRow(e);
|
shakeTableRow(e);
|
||||||
} else {
|
} else {
|
||||||
$(".table-context-menu").fadeIn("fast");
|
$(".table-context-menu").fadeIn("fast");
|
||||||
|
determineContextMenuItems();
|
||||||
$(".table-context-menu").css({
|
$(".table-context-menu").css({
|
||||||
left: getMenuPosition(xPosition, 'width', 'scrollLeft'),
|
left: getMenuPosition(xPosition, 'width', 'scrollLeft'),
|
||||||
top: getMenuPosition(yPosition, 'height', 'scrollTop')
|
top: getMenuPosition(yPosition, 'height', 'scrollTop')
|
||||||
});
|
});
|
||||||
determineContextMenuItems();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function shakeTableRow(e) {
|
function shakeTableRow(e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user