Merge branches 'master' and 'issues/631' of https://github.com/SVG-Edit/svgedit into issues/631

master
agriyadev5 2021-09-22 17:14:36 +05:30
commit 755c375a9e
3 changed files with 14 additions and 20 deletions

View File

@ -652,7 +652,7 @@ class Editor extends EditorStartup {
if (context) { if (context) {
let str = ''; let str = '';
linkStr = '<a href="#" data-root="y">' + this.svgCanvas.getCurrentDrawing().getCurrentLayerName() + '</a>'; linkStr = '<a href="#" data-root="y">' + this.svgCanvas.getCurrentDrawing().getCurrentLayerName() + '</a>';
const parentsUntil = getParentsUntil(context, '#svgcontent > g'); const parentsUntil = getParentsUntil(context, '#svgcontent');
parentsUntil.forEach(function (parent) { parentsUntil.forEach(function (parent) {
if (parent.id) { if (parent.id) {
str += ' > ' + parent.id; str += ' > ' + parent.id;

View File

@ -140,11 +140,10 @@ class EditorStartup {
this.selectedElement = null; this.selectedElement = null;
this.multiselected = false; this.multiselected = false;
const aLinks = $id('cur_context_panel').querySelectorAll('a'); const aLink = $id('cur_context_panel');
for (const aLink of aLinks) {
aLink.addEventListener('click', (evt) => { aLink.addEventListener('click', (evt) => {
const link = evt.currentTarget; const link = evt.target;
if (link.hasAttribute('data-root')) { if (link.hasAttribute('data-root')) {
this.svgCanvas.leaveContext(); this.svgCanvas.leaveContext();
} else { } else {
@ -153,7 +152,6 @@ class EditorStartup {
this.svgCanvas.clearSelection(); this.svgCanvas.clearSelection();
return false; return false;
}); });
}
// bind the selected event to our function that handles updates to the UI // bind the selected event to our function that handles updates to the UI
this.svgCanvas.bind('selected', this.selectedChanged.bind(this)); this.svgCanvas.bind('selected', this.selectedChanged.bind(this));

View File

@ -1,6 +1,6 @@
:root { :root {
--main-bg-color: #72797A; --main-bg-color: #72797A;
--text-color: #ffffff; --text-color: #000000;
--border-color: #808080; --border-color: #808080;
--canvas-bg-color: #B2B2B2; --canvas-bg-color: #B2B2B2;
--link-color: #19c; --link-color: #19c;
@ -384,17 +384,13 @@ hr {
} }
#cur_context_panel { #cur_context_panel {
position: absolute; grid-area: rulerX;
top: 57px;
left: 56px;
line-height: 22px; line-height: 22px;
overflow: auto; overflow: auto;
padding-left: 5px; padding-left: 5px;
font-size: 12px; font-size: 12px;
background: rgba(0, 0, 0, 0.8); background: rgba(0, 0, 0, 0.8);
color: #ccc; color: #ccc;
padding: 0 10px;
border-radius: 0 0 3px 0;
} }
#cur_context_panel a { #cur_context_panel a {