refactor(es modules): continue migration

This commit is contained in:
Azgaar 2022-06-26 01:25:25 +03:00
parent 922c6e2431
commit 364f33975f
50 changed files with 180 additions and 85 deletions

View file

@ -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) {

View file

@ -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();

View file

@ -1,4 +1,5 @@
import {store} from "../../utils/shorthands";
import {tip} from "../tooltips";
export function assignLockBehavior() {
const $lockable = document.querySelectorAll("[data-locked]");