assets/js/frame.js in appscms-tools-theme-2.2.9 vs assets/js/frame.js in appscms-tools-theme-2.3.0
- old
+ new
@@ -89,10 +89,13 @@
}
})
}
const drawImage = () => {
+ workspace.style.display = 'block'
+ document.querySelector('#upper-panel').style.display = 'none'
+ document.querySelector('#saving-data').style.display = 'flex'
let img = new Image()
img.src = featureData.effectImagePath
var canvas = document.createElement('canvas')
var ctx = canvas.getContext('2d')
img.onload = () => {
@@ -155,12 +158,12 @@
}
if (item.type === 'rectangle') {
}
})
canvasPanel.innerHTML = ''
+ document.querySelector('#saving-data').style.display = 'none'
canvasPanel.appendChild(canvas)
- workspace.style.display = 'block'
})
}
}
const cropImage = (result, id) => {
let image = new Image()
@@ -170,11 +173,10 @@
img.id = 'image'
document.querySelector('.crop-image-modal-body').appendChild(img)
cropper = new Cropper(img, {
viewMode: 3,
ready() {
- console.log(id)
let find = featureData.elements.find((i) => i.id === id)
console.log(find)
cropper.setAspectRatio(Number(find.width) / Number(find.height))
cropModal.style.display = 'flex'
this.cropper.crop()
@@ -198,10 +200,13 @@
width: cropWidth,
height: cropHeight,
})
.toDataURL()
files[index - 1] = cropperImg
+ document.querySelector(`#image-pre-${index}`).src = cropperImg
+ document.querySelector(`#image-pre-${index}`).style.display = 'block'
+ document.querySelector(`#cam-${index}`).style.display = 'none'
cropModal.style.display = 'none'
})
const openExamplesModal = () => {
exampleModal.style.display = 'flex'
}
@@ -231,10 +236,10 @@
download.addEventListener('click', () => {
let canvas = document.querySelector('canvas')
let url = canvas.toDataURL(`image/png`)
let a = document.createElement('a')
a.href = url
- a.download = `safeimagekit-border-image.${inputFile.type.split('/')[1]}`
+ a.download = `safeimagekit-photo-effect-image.png`
document.body.appendChild(a)
a.click()
if (lang === 'en') {
window.location.href = `/download?tool=${pageTool}`
} else {