This commit is contained in:
Max Hunt 2020-05-18 10:14:43 +01:00
parent ce25d87c0b
commit bcc878396b
3 changed files with 40 additions and 20 deletions

View File

@ -465,7 +465,7 @@ input:focus, textarea:focus, select:focus{
.n-p-left { .n-p-left {
position: relative; position: relative;
width: 50%; width: 40%;
z-index: 2; z-index: 2;
} }
.n-p-right { .n-p-right {

File diff suppressed because one or more lines are too long

View File

@ -52,7 +52,7 @@ async function productSubmitEventHandler(){
imageRef.put(image).then(function(){ imageRef.put(image).then(function(){
submitBtn.innerHTML = "Done! Go Home..." submitBtn.innerHTML = "Done! Go Home..."
submitBtn.disabled = false submitBtn.disabled = false
submitBtn.setAttribute('style', 'background:#00FF55; transition:0.5s; width:162%;') submitBtn.setAttribute('style', 'background:#00FF55; transition:0.5s; width:203%;')
}) })
.catch(e=>{ .catch(e=>{
submitBtn.innerHTML = "Error..." submitBtn.innerHTML = "Error..."
@ -436,26 +436,46 @@ function sendAR(approved, prodID) {
} }
function initFileDropListner() { function initFileDropListner() {
try{
let dropZone = document.getElementById("dropzone") let dropZone = document.getElementById("dropzone")
let imgPreview = document.getElementById("imgPreview")
let svgElement = document.getElementById('svgElement')
if (dropZone) { if (dropZone) {
let fInput = document.getElementById('imgInput') let fInput = document.getElementById('imgInput')
dropZone.ondragover = function(){this.className = "dropzone dragover";return false} dropZone.ondragover = function(){
dropZone.ondragleave = function(){this.className = "dropzone";return false} this.className = "dropzone dragover"
imgPreview.setAttribute('style', 'display: none;')
svgElement.setAttribute('style', 'display: block;')
return false
}
dropZone.ondragleave = function(){
this.className = "dropzone"
// imgPreview.setAttribute('style', 'display:block')
return false
}
dropZone.onclick = function(){ dropZone.onclick = function(){
fInput.click() fInput.click()
} }
fInput.onchange = function(event) { fInput.onchange = function(event) {
let addedFile = event.target.files[0] let addedFile = event.target.files[0]
fileAddSequence(addedFile) fileAddSequence(addedFile)
} }
dropZone.ondrop = function(event) { dropZone.ondrop = function(event) {
event.preventDefault() event.preventDefault()
this.className = "dropzone" this.className = "dropzone"
let droppedFile = event.dataTransfer.files[0] let droppedFile = event.dataTransfer.files[0]
console.log(droppedFile)
fileAddSequence(droppedFile) fileAddSequence(droppedFile)
return false
} }
} }
} }
catch(error){}
}
initFileDropListner() initFileDropListner()