mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-12 20:23:52 +00:00
Zoom control tooltips
This commit is contained in:
parent
0c2836a27f
commit
1dab9a3996
@ -14,6 +14,7 @@ declare let window: {
|
|||||||
// these attributes and functions are supported by major browsers, but TS does not know about them
|
// these attributes and functions are supported by major browsers, but TS does not know about them
|
||||||
declare global {
|
declare global {
|
||||||
interface SVGElement {
|
interface SVGElement {
|
||||||
|
getElementById: (id: string) => SVGGraphicsElement | null;
|
||||||
viewBox: SVGAnimatedRect;
|
viewBox: SVGAnimatedRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,9 +296,16 @@ class MathjaxProofTree extends MathjaxAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// @ts-ignore
|
// add tooltips to buttons
|
||||||
let matrix = svg.getElementById("svg-pan-zoom-controls").transform.baseVal[0].matrix;
|
const zoomIn = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
||||||
|
zoomIn.append(document.createTextNode("zoom in"));
|
||||||
|
svg.getElementById("svg-pan-zoom-zoom-in")!.children[0].appendChild(zoomIn);
|
||||||
|
const zoomOut = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
||||||
|
zoomOut.append(document.createTextNode("zoom out"));
|
||||||
|
svg.getElementById("svg-pan-zoom-zoom-out")!.appendChild(zoomOut);
|
||||||
|
|
||||||
// move control to upper left corner
|
// move control to upper left corner
|
||||||
|
let matrix = svg.getElementById("svg-pan-zoom-controls")!.transform.baseVal[0].matrix;
|
||||||
matrix.e = 0;
|
matrix.e = 0;
|
||||||
matrix.f = 0;
|
matrix.f = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user