aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbymap.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dumbymap.mjs')
-rw-r--r--src/dumbymap.mjs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs
index d8349c6..47c629c 100644
--- a/src/dumbymap.mjs
+++ b/src/dumbymap.mjs
@@ -372,18 +372,17 @@ export const generateMaps = async (container) => {
372 } 372 }
373 373
374 if (layout === 'overlay') { 374 if (layout === 'overlay') {
375 let x = 0; 375 let [x, y] = [0, 0];
376 let y = 0;
377 htmlHolder.blocks.forEach(block => { 376 htmlHolder.blocks.forEach(block => {
378 // Add draggable instance 377 // Add draggable instance
379 block.draggableInstance = new PlainDraggable(block, { 378 block.draggableInstance = new PlainDraggable(block, {
380 handle: block.draggablePart, 379 handle: block.draggablePart,
381 snap: { x: { step: 20 }, y: { step: 20 } }, 380 snap: { x: { step: 20 }, y: { step: 20 } },
382 autoScroll: false, 381 left: x,
382 top: y,
383 }) 383 })
384
384 // Set initial postion side by side 385 // Set initial postion side by side
385 block.style.left = `${x}px`
386 block.style.top = `${y}px`
387 x += parseInt(window.getComputedStyle(block).width) + 50 386 x += parseInt(window.getComputedStyle(block).width) + 50
388 if (x > window.innerWidth) { 387 if (x > window.innerWidth) {
389 y += 200 388 y += 200