mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 20:48:27 +00:00
hotfix: fix build error
This commit is contained in:
parent
edfa0c65f9
commit
9b5842b20e
@ -1,6 +1,6 @@
|
|||||||
const parser = new DOMParser();
|
const parser = typeof DOMParser !== 'undefined' ? new DOMParser() : null;
|
||||||
export let html = (string) => {
|
export let html = (string) => {
|
||||||
return parser.parseFromString(string, 'text/html').querySelectorAll('*');
|
return parser?.parseFromString(string, 'text/html').querySelectorAll('*');
|
||||||
};
|
};
|
||||||
let parseChunk = (chunk) => {
|
let parseChunk = (chunk) => {
|
||||||
if (Array.isArray(chunk)) return chunk.flat().join('');
|
if (Array.isArray(chunk)) return chunk.flat().join('');
|
||||||
|
|||||||
@ -6,26 +6,28 @@ const getDocLabel = (doc) => doc.name || doc.longname;
|
|||||||
|
|
||||||
let ctrlDown = false;
|
let ctrlDown = false;
|
||||||
|
|
||||||
// Record Control key event to trigger or block the tooltip depending on the state
|
if (typeof window !== 'undefined') {
|
||||||
window.addEventListener(
|
// Record Control key event to trigger or block the tooltip depending on the state
|
||||||
'keyup',
|
window.addEventListener(
|
||||||
function (e) {
|
'keyup',
|
||||||
if (e.key == 'Control') {
|
function (e) {
|
||||||
ctrlDown = false;
|
if (e.key == 'Control') {
|
||||||
}
|
ctrlDown = false;
|
||||||
},
|
}
|
||||||
true,
|
},
|
||||||
);
|
true,
|
||||||
|
);
|
||||||
|
|
||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'keydown',
|
'keydown',
|
||||||
function (e) {
|
function (e) {
|
||||||
if (e.key == 'Control') {
|
if (e.key == 'Control') {
|
||||||
ctrlDown = true;
|
ctrlDown = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export const strudelTooltip = hoverTooltip(
|
export const strudelTooltip = hoverTooltip(
|
||||||
(view, pos, side) => {
|
(view, pos, side) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user