fix: firefox bugs

This commit is contained in:
Safwan Samsudeen 2024-04-30 17:39:03 +05:30
parent 6ce4da519b
commit b29076afed
4 changed files with 378 additions and 378 deletions

717
dist/frappe-gantt.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -309,7 +309,7 @@ export default class Bar {
'mouseenter',
(e) =>
(timeout = setTimeout(() => {
this.show_popup(e.offsetX);
this.show_popup(e.offsetX || e.layerX);
document.getElementById(
`${task_id}-highlight`,
).style.display = 'block';

View File

@ -975,8 +975,8 @@ export default class Gantt {
if (this.popup) this.popup.parent.classList.add('hidden');
x_on_start = e.offsetX;
y_on_start = e.offsetY;
x_on_start = e.offsetX || e.layerX;
y_on_start = e.offsetY || e.layerY;
parent_bar_id = bar_wrapper.getAttribute('data-id');
const ids = [
@ -1064,8 +1064,8 @@ export default class Gantt {
$.on(this.$svg, 'mousemove', (e) => {
if (!action_in_progress()) return;
const dx = e.offsetX - x_on_start;
const dy = e.offsetY - y_on_start;
console.log(e)
const dx = (e.offsetX || e.layerX) - x_on_start;
bars.forEach((bar) => {
const $bar = bar.$bar;
@ -1123,8 +1123,8 @@ export default class Gantt {
$.on(this.$svg, 'mousedown', '.handle.progress', (e, handle) => {
is_resizing = true;
x_on_start = e.offsetX;
y_on_start = e.offsetY;
x_on_start = e.offsetX || e.layerX;
y_on_start = e.offsetY || e.layerY;
const $bar_wrapper = $.closest('.bar-wrapper', handle);
const id = $bar_wrapper.getAttribute('data-id');
@ -1141,8 +1141,7 @@ export default class Gantt {
$.on(this.$svg, 'mousemove', (e) => {
if (!is_resizing) return;
let dx = e.offsetX - x_on_start;
let dy = e.offsetY - y_on_start;
let dx = (e.offsetX || e.layerX) - x_on_start;
if (dx > $bar_progress.max_dx) {
dx = $bar_progress.max_dx;