assets/js/frame.js in appscms-tools-theme-2.7.4 vs assets/js/frame.js in appscms-tools-theme-2.7.5
- old
+ new
@@ -18,17 +18,16 @@
let cropInputHeight = null
let image = null
const showLoader = () => {
showLoading()
}
-const closeLoader = () => {}
+const closeLoader = () => { }
const clickInput = (e) => {
console.log(`#file-${e.dataset.index}`)
document.querySelector(`#file-${e.dataset.index}`).click()
}
let featureData = null
-
fetch('/assets/js/photo-effects.json')
.then((response) => response.json())
.then((data) => {
featureData = data.find((i) => i.name === form.dataset.featureName)
console.log(featureData)
@@ -90,21 +89,18 @@
[item.perspective.topRight.x, item.perspective.topRight.y],
[item.perspective.bottomRight.x, item.perspective.bottomRight.y],
[item.perspective.bottomLeft.x, item.perspective.bottomLeft.y],
])
}
-
if (item.skew) {
ctx.setTransform(1, item.skew.x, item.skew.y, 1, 0, 0)
}
-
ctx.restore()
resolve()
}
})
}
-
const drawImage = () => {
workspace.style.display = 'block'
document.querySelector('#upper-panel').style.display = 'none'
document.querySelector('#saving-data').style.display = 'flex'
let img = new Image()
@@ -148,11 +144,10 @@
}
ctx.font = `${item.fontSize}px ${item.font}`
if (item.shadowColor) {
ctx.shadowColor = `${item.shadowColor}`
}
-
if (item.shadowOffsetX) {
ctx.shadowOffsetX = 3
}
if (item.shadowOffsetY) {
ctx.shadowOffsetY = 3
@@ -177,10 +172,11 @@
canvasPanel.appendChild(canvas)
})
}
}
const cropImage = (result, id) => {
+ document.body.style.overflow = "hidden"
let image = new Image()
image.onload = () => {
let img = document.createElement('img')
img.src = result
img.id = 'image'
@@ -217,10 +213,11 @@
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'
+ document.body.style.overflow = "auto"
})
const openExamplesModal = () => {
exampleModal.style.display = 'flex'
}
let inputFile = ''
@@ -257,6 +254,6 @@
if (lang === 'en') {
window.location.href = `/download?tool=${pageTool}`
} else {
window.location.href = `/${lang}/download?tool=${pageTool}`
}
-})
+})
\ No newline at end of file