gantt-lib 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -449,10 +449,15 @@ var calculateGridWidth = (daysInMonth, dayWidth) => {
|
|
|
449
449
|
var detectEdgeZone = (clientX, taskBarElement, edgeZoneWidth = 12) => {
|
|
450
450
|
const rect = taskBarElement.getBoundingClientRect();
|
|
451
451
|
const relativeX = Math.round(clientX - rect.left);
|
|
452
|
+
const width = Math.round(rect.width);
|
|
453
|
+
if (width <= 2 * edgeZoneWidth) {
|
|
454
|
+
const distanceToLeft = relativeX;
|
|
455
|
+
const distanceToRight = width - relativeX;
|
|
456
|
+
return distanceToLeft <= distanceToRight ? "left" : "right";
|
|
457
|
+
}
|
|
452
458
|
if (relativeX >= 0 && relativeX <= edgeZoneWidth) {
|
|
453
459
|
return "left";
|
|
454
460
|
}
|
|
455
|
-
const width = Math.round(rect.width);
|
|
456
461
|
if (relativeX >= width - edgeZoneWidth && relativeX <= width) {
|
|
457
462
|
return "right";
|
|
458
463
|
}
|