added event listener to input to prevent spaces
This commit is contained in:
parent
e99e8291bd
commit
afae6a79c3
2 changed files with 7 additions and 2 deletions
|
@ -120,8 +120,7 @@ function previewAndStageFile(selectedFile){
|
||||||
// set the name input value to the image name if none is set yet
|
// set the name input value to the image name if none is set yet
|
||||||
if (nameInput.value === "") {
|
if (nameInput.value === "") {
|
||||||
var filename = selectedFile.name.substring(0, selectedFile.name.indexOf('.'))
|
var filename = selectedFile.name.substring(0, selectedFile.name.indexOf('.'))
|
||||||
filename = filename.replace(/\s+/g, '-');
|
nameInput.value = filename.replace(/\s+/g, '-');;
|
||||||
nameInput.value = filename;
|
|
||||||
}
|
}
|
||||||
// store the selected file for upload
|
// store the selected file for upload
|
||||||
stagedFiles = [selectedFile];
|
stagedFiles = [selectedFile];
|
||||||
|
|
|
@ -58,4 +58,10 @@
|
||||||
document.getElementById('publish-active-area').innerHTML = publishResults;
|
document.getElementById('publish-active-area').innerHTML = publishResults;
|
||||||
window.location.href = showUrl;
|
window.location.href = showUrl;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//event listener to filter claim name inputs
|
||||||
|
document.getElementById('publish-name').addEventListener('input', function() {
|
||||||
|
var name = this.value;
|
||||||
|
this.value = name.replace(/\s+/g, '-');
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue