mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-19 12:50:11 -05:00
Fix decorative image upload button not appearing after reselection
The properties panel used strict equality check (attrs.name === 'decorative-image')
which failed when the element name was modified (e.g., 'decorative-image element-overlap').
This caused the upload button to disappear when reselecting a decorative image
that wasn't uploaded immediately after creation.
Changed the check to use includes('decorative-image') to match the behavior
of the event listeners, ensuring the upload button always appears for
decorative image elements regardless of name modifications.
Fixes issue where users couldn't upload images to decorative image elements
after deselecting and reselecting them.
This commit is contained in:
@@ -3192,7 +3192,8 @@ function initializePDFEditor() {
|
||||
}
|
||||
|
||||
// Decorative image properties
|
||||
if (attrs.name === 'decorative-image') {
|
||||
// Use includes() to handle cases where name might be modified (e.g., 'decorative-image element-overlap')
|
||||
if (attrs.name && attrs.name.includes('decorative-image')) {
|
||||
// Use getAttr to ensure we get the imageUrl
|
||||
const imageUrl = node.getAttr('imageUrl') || attrs.imageUrl || '';
|
||||
console.log('Properties panel - decorative image URL:', imageUrl);
|
||||
|
||||
@@ -3606,7 +3606,8 @@ function initializePDFEditor() {
|
||||
}
|
||||
|
||||
// Decorative image properties
|
||||
if (attrs.name === 'decorative-image') {
|
||||
// Use includes() to handle cases where name might be modified (e.g., 'decorative-image element-overlap')
|
||||
if (attrs.name && attrs.name.includes('decorative-image')) {
|
||||
// Use getAttr to ensure we get the imageUrl
|
||||
const imageUrl = node.getAttr('imageUrl') || attrs.imageUrl || '';
|
||||
console.log('Properties panel - decorative image URL:', imageUrl);
|
||||
|
||||
Reference in New Issue
Block a user