From 26fc8eeb49b86deb1ada529586abd62b5ddf9f24 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Sat, 22 May 2021 23:18:59 +0200 Subject: [PATCH] fix bugs and position on safari --- src/editor/components/seExplorerButton.js | 4 ++-- src/editor/components/seFlyingButton.js | 12 ++++++------ src/svgcanvas/elem-get-set.js | 2 +- src/svgcanvas/selected-elem.js | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/editor/components/seExplorerButton.js b/src/editor/components/seExplorerButton.js index 8d1673a3..56a0418c 100644 --- a/src/editor/components/seExplorerButton.js +++ b/src/editor/components/seExplorerButton.js @@ -151,9 +151,9 @@ export class ExplorerButton extends HTMLElement { break; case 'disabled': if (newValue) { - this.$div.classList.add('disabled'); + this.$overall.classList.add('disabled'); } else { - this.$div.classList.remove('disabled'); + this.$overall.classList.remove('disabled'); } break; case 'lib': diff --git a/src/editor/components/seFlyingButton.js b/src/editor/components/seFlyingButton.js index 1b7bfddb..45944d1e 100644 --- a/src/editor/components/seFlyingButton.js +++ b/src/editor/components/seFlyingButton.js @@ -47,7 +47,6 @@ template.innerHTML = ` } .menu { position: absolute; - top:-2px; left:32px; background: none !important; display:none; @@ -68,13 +67,14 @@ template.innerHTML = `
+ - +
`; @@ -139,9 +139,9 @@ export class FlyingButton extends HTMLElement { break; case 'disabled': if (newValue) { - this.$div.classList.add('disabled'); + this.$overall.classList.add('disabled'); } else { - this.$div.classList.remove('disabled'); + this.$overall.classList.remove('disabled'); } break; default: diff --git a/src/svgcanvas/elem-get-set.js b/src/svgcanvas/elem-get-set.js index f47ad098..95276629 100644 --- a/src/svgcanvas/elem-get-set.js +++ b/src/svgcanvas/elem-get-set.js @@ -794,7 +794,7 @@ export const setLinkURLMethod = function (val) { if (elem.tagName !== 'a') { // See if parent is an anchor const parentsA = getParents(elem.parentNode, 'a'); - if (parentsA.length) { + if (parentsA?.length) { elem = parentsA[0]; } else { return; diff --git a/src/svgcanvas/selected-elem.js b/src/svgcanvas/selected-elem.js index 39b3f472..f4590ee5 100644 --- a/src/svgcanvas/selected-elem.js +++ b/src/svgcanvas/selected-elem.js @@ -875,7 +875,7 @@ export const ungroupSelectedElement = function () { return; } const parentsA = getParents(g.parentNode, 'a'); - if (parentsA.length) { + if (parentsA?.length) { g = parentsA[0]; }