only show rename info on update of file
This commit is contained in:
@@ -35,11 +35,6 @@
|
||||
document.getElementById('{{ $name }}_name').innerText = fileName;
|
||||
document.getElementById('{{ $name }}_name').classList.add('italic');
|
||||
|
||||
const newFileInfo = document.createElement('i');
|
||||
newFileInfo.classList.add('fa-solid', 'fa-info-circle', 'text-gray-500', 'ml-2');
|
||||
newFileInfo.setAttribute('data-tooltip', 'The filename may change from the actual file name if a file with the same name already exists.');
|
||||
document.getElementById('{{ $name }}_name').appendChild(newFileInfo);
|
||||
|
||||
document.getElementById('{{ $name }}_size').innerText = SM.bytesToString(fileSize);
|
||||
|
||||
if(fileType.startsWith('image/')) {
|
||||
@@ -61,6 +56,12 @@
|
||||
const reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
updateDetails(file.name, file.type, file.size, e.target.result);
|
||||
|
||||
const newFileInfo = document.createElement('i');
|
||||
newFileInfo.classList.add('fa-solid', 'fa-info-circle', 'text-gray-500', 'ml-2');
|
||||
newFileInfo.setAttribute('data-tooltip', 'The filename may change from the actual file name if a file with the same name already exists.');
|
||||
document.getElementById('{{ $name }}_name').appendChild(newFileInfo);
|
||||
|
||||
if('{{ $onchange }}' !== '' && typeof window['{{ $onchange }}'] === 'function') {
|
||||
window['{{ $onchange }}'](file, file.name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user