FIX: misnamed sorting attribute for uploaded files

when creating new ui elements for uploaded files, the 'data-source'
attribute was being created to store the upload path for the file which
is used to save that info in the page doc.

that attribute should be 'data-id' as that is what sortablejs looks for
when sorting element data into arrays
This commit is contained in:
ro 2024-07-09 13:38:02 -06:00
parent 9f6d1970ce
commit 4520c9b608
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50

View file

@ -143,7 +143,7 @@ export default class FileManager {
self.mm
.filesUpload(theFile.type, upload, progress)
.then(result => {
item.setAttribute('data-source', result.filePath);
item.setAttribute('data-id', result.filePath);
let video = document.createElement('video');
let source = document.createElement('source');
source.src = f.target.result;
@ -169,7 +169,7 @@ export default class FileManager {
self.mm
.filesUpload(theFile.type, upload, progress)
.then(result => {
item.setAttribute('data-source', result.filePath);
item.setAttribute('data-id', result.filePath);
let audio = document.createElement('audio');
audio.setAttribute('controls', true);
let source = document.createElement('source');
@ -198,7 +198,7 @@ export default class FileManager {
self.mm
.filesUpload(theFile.type, upload, progress)
.then(result => {
item.setAttribute('data-source', result.filePath);
item.setAttribute('data-id', result.filePath);
let link = document.createElement('a');
link.href = result.filePath;
link.innerHTML = result.fileName;