keep preview when clicking there

This commit is contained in:
Anthony Lieuallen 2022-11-21 10:10:37 -05:00
parent 98a6c30465
commit 9b72b0bf93
1 changed files with 3 additions and 0 deletions

View File

@ -337,6 +337,9 @@ svg.addEventListener('mouseout', e => {
document.body.addEventListener('click', e => {
let el = e.target;
// Ignore clicks, i.e. to select, in the preview.
if (document.getElementById('preview').contains(el)) return;
// Remove possible forced stroke from previously-locked color.
document.querySelectorAll('polygon[style]').forEach(el => {
el.removeAttribute('style');