Remove leading slash from data-path attributes

This commit is contained in:
Olivia Godone-Maresca 2023-02-16 23:29:32 -05:00
parent df93fee034
commit 09c1dfd92b

View File

@ -495,10 +495,6 @@ class ModelDropdown
return { width, height }
}
getFolder(model) {
return model.substring(0, model.lastIndexOf('/') + 1)
}
/**
* @param {Array<string>} models
*/
@ -607,7 +603,8 @@ class ModelDropdown
if (isRootFolder) {
classes.push('in-root-folder')
}
const fullPath = `${folderName || ''}/${model}`
// Remove the leading slash from the model path
const fullPath = folderName ? `${folderName.substring(1)}/${model}` : model
modelsMap.set(
model,
this.createElement('li', { 'data-path': fullPath }, classes, model),