now crop path is clickable in web component...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-11-02 22:54:55 +03:00
parent 6d6994c115
commit 8183fdd3a7
2 changed files with 14 additions and 6 deletions

View File

@ -284,17 +284,17 @@
border: none;
background: none;
&>.text {
.text {
display: none;
}
}
&,
&[cropped] {
margin-left: 0;
& .text {
display: block;
}
}
/* XXX nesting this in &[cropped] for some reaon breaks things... */
&[cropped] .text {
display: block;
}
}

View File

@ -1255,7 +1255,7 @@ var Outline = {
+ this.path(...arguments, 'text')
.slice(0, -1)
.map(function(s, i, {length}){
return `<span class="path-item" onclick="editor.uncrop(${ length-i })">${
return `<span class="path-item" uncrop="${ length-i }">${
plugin.encode(s)
}</span> ` })
.join(' / ')
@ -2177,6 +2177,14 @@ var Outline = {
function(evt){
that.__change__() })
// header...
var header = this.header
header.addEventListener('click',
function(evt){
var elem = evt.target
if(elem.classList.contains('path-item')){
that.uncrop(elem.getAttribute('uncrop') ?? 'all') } })
// toolbar...
var toolbar = this.toolbar
if(toolbar){