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; border: none;
background: none; background: none;
&>.text { .text {
display: none; display: none;
} }
} }
&, &,
&[cropped] { &[cropped] {
margin-left: 0; margin-left: 0;
}
& .text { /* XXX nesting this in &[cropped] for some reaon breaks things... */
display: block; &[cropped] .text {
} display: block;
} }
} }

View File

@ -1255,7 +1255,7 @@ var Outline = {
+ this.path(...arguments, 'text') + this.path(...arguments, 'text')
.slice(0, -1) .slice(0, -1)
.map(function(s, i, {length}){ .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) plugin.encode(s)
}</span> ` }) }</span> ` })
.join(' / ') .join(' / ')
@ -2177,6 +2177,14 @@ var Outline = {
function(evt){ function(evt){
that.__change__() }) 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... // toolbar...
var toolbar = this.toolbar var toolbar = this.toolbar
if(toolbar){ if(toolbar){