mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
refactor(es modules): continue migration
This commit is contained in:
parent
922c6e2431
commit
364f33975f
50 changed files with 180 additions and 85 deletions
|
|
@ -20,7 +20,8 @@ import {Rulers, Ruler, drawScaleBar} from "./modules/measurers";
|
|||
import {byId} from "./utils/shorthands";
|
||||
import {addGlobalListeners} from "./scripts/listeners";
|
||||
import {restoreDefaultEvents} from "./scripts/events";
|
||||
import {clearMainTip} from "./scripts/tooltips";
|
||||
import {clearMainTip, tip} from "./scripts/tooltips";
|
||||
import {clearLegend} from "./modules/legend";
|
||||
import "./components";
|
||||
|
||||
addGlobalListeners();
|
||||
|
|
@ -61,6 +62,10 @@ svgWidth = graphWidth;
|
|||
svgHeight = graphHeight;
|
||||
|
||||
defineSvg(graphWidth, graphHeight);
|
||||
scaleBar.on("mousemove", () => tip("Click to open Units Editor")).on("click", () => editUnits());
|
||||
legend
|
||||
.on("mousemove", () => tip("Drag to change the position. Click to hide the legend"))
|
||||
.on("click", () => clearLegend());
|
||||
|
||||
document.on("DOMContentLoaded", async () => {
|
||||
if (!location.hostname) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {dragLegendBox} from "../modules/legend";
|
||||
import {findCell, findGridCell} from "../utils/graphUtils";
|
||||
import {showMainTip} from "./tooltips";
|
||||
import {tip, showMainTip} from "./tooltips";
|
||||
|
||||
export function restoreDefaultEvents() {
|
||||
Zoom.setZoomBehavior();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import {store} from "../../utils/shorthands";
|
||||
import {tip} from "../tooltips";
|
||||
|
||||
export function assignLockBehavior() {
|
||||
const $lockable = document.querySelectorAll("[data-locked]");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue