Remove file suffix when uploading
This commit is contained in:
parent
f53bb7acb6
commit
874f4bd681
|
|
@ -158,8 +158,9 @@ function handleFiles(files, type) {
|
||||||
(type == "skin") ? MSP.changeSkin(img.src) : MSP.changeCape(img.src);
|
(type == "skin") ? MSP.changeSkin(img.src) : MSP.changeCape(img.src);
|
||||||
let domTextureName = $('#name');
|
let domTextureName = $('#name');
|
||||||
if (domTextureName.val() === '' || domTextureName.val() === domTextureName.attr('data-last-file-name')) {
|
if (domTextureName.val() === '' || domTextureName.val() === domTextureName.attr('data-last-file-name')) {
|
||||||
domTextureName.attr('data-last-file-name', file.name);
|
const fileName = file.name.replace(/\.[Pp][Nn][Gg]$/, '');
|
||||||
domTextureName.val(file.name);
|
domTextureName.attr('data-last-file-name', fileName);
|
||||||
|
domTextureName.val(fileName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
img.onerror = () => toastr.warning(trans('skinlib.fileExtError'));
|
img.onerror = () => toastr.warning(trans('skinlib.fileExtError'));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user