From: Mischa POSLAWSKY Date: Wed, 19 Jan 2022 19:35:36 +0000 (+0100) Subject: word/edit: image container only needed for source X-Git-Tag: v1.13~27 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/37c06bb073070304a9dcb93d69044208d388b068 word/edit: image container only needed for source --- diff --git a/word/edit.plp b/word/edit.plp index 40bf8af..f41b0ab 100644 --- a/word/edit.plp +++ b/word/edit.plp @@ -260,9 +260,12 @@ for my $col (@wordcols) { printf ''; print $row->input($col => $attr); if (my $imgsrc = $attr->{-src}) { - printf('%s', - $col, $_, $row->{form}, $col eq 'source' && ' hidden' + my $hide = $col eq 'source'; + printf '', $col unless $hide; + printf('%s', + $_, $row->{form}, $hide && qq( id="${col}preview" hidden) ) for grep { -e } $imgsrc->($row); + printf '' unless $hide; } print $row->input($_ => delete $wordcol{$_}) for @span; print ''; diff --git a/word/editor.js b/word/editor.js index c71faa5..a4b8d8e 100644 --- a/word/editor.js +++ b/word/editor.js @@ -184,7 +184,7 @@ document.addEventListener('DOMContentLoaded', () => { recrop(); } - imgselect.src = imgpreview.children[0].src; + imgselect.src = imgpreview.src; imgselect.style.cursor = 'grab'; imgselect.style.position = 'absolute'; recrop();