Merge pull request #1354 from foivospro/main
Fix Error When Submitting Crop Tool Without Making a Selection
This commit is contained in:
commit
fcd4af2d09
1 changed files with 12 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}" xmlns:th="https://www.thymeleaf.org">
|
<html th:lang="${#locale.language}" th:dir="#{language.direction}" th:data-language="${#locale.toString()}" xmlns:th="https://www.thymeleaf.org">
|
||||||
<head>
|
<head>
|
||||||
<th:block th:insert="~{fragments/common :: head(title=#{crop.title}, header=#{crop.header})}"></th:block>
|
<th:block th:insert="~{fragments/common :: head(title=#{crop.title}, header=#{crop.header})}"></th:block>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -75,6 +75,16 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cropForm.addEventListener('submit', function(e) {
|
||||||
|
if (xInput.value == "" && yInput.value == "" && widthInput.value == "" && heightInput.value == "") {
|
||||||
|
// Ορίστε συντεταγμένες για ολόκληρη την επιφάνεια του PDF
|
||||||
|
xInput.value = 0;
|
||||||
|
yInput.value = 0;
|
||||||
|
widthInput.value = pdfCanvas.width;
|
||||||
|
heightInput.value = pdfCanvas.height;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
overlayCanvas.addEventListener('mousedown', function(e) {
|
overlayCanvas.addEventListener('mousedown', function(e) {
|
||||||
// Clear previously drawn rectangle on the main canvas
|
// Clear previously drawn rectangle on the main canvas
|
||||||
context.clearRect(0, 0, pdfCanvas.width, pdfCanvas.height);
|
context.clearRect(0, 0, pdfCanvas.width, pdfCanvas.height);
|
||||||
|
@ -138,4 +148,4 @@
|
||||||
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
|
<th:block th:insert="~{fragments/footer.html :: footer}"></th:block>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue