Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -423,3 +423,8 @@ li {
width: 100% !important;
}
}

.disabledButton {
pointer-events: none;
opacity: 0.4;
}
7 changes: 7 additions & 0 deletions app/static/js/calculator/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
message: "Start calculating. Please wait...",
timeout: 0,
});
calculateBtn.classList.add("disabledButton");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's set button disabled attribute instead of css

// binsResultsDiv.innerHTML = "";
imagesResultDiv.innerHTML = "";
let addedBins = [];
Expand All @@ -59,6 +60,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
iziToast.error({
message: "Incorrect sheet sizes",
});
calculateBtn.classList.remove("disabledButton");
return;
}

Expand All @@ -81,6 +83,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
iziToast.error({
message: "Incorrect artwork sizes",
});
calculateBtn.classList.remove("disabledButton");
return;
}
addedRects.push({
Expand Down Expand Up @@ -129,6 +132,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
title: "Error",
message: e.message,
});
calculateBtn.classList.remove("disabledButton");
return;
}

Expand All @@ -138,6 +142,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
position: "bottomRight",
title: "Calculation Error",
});
calculateBtn.classList.remove("disabledButton");
return;
}

Expand All @@ -149,6 +154,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
title: "Error",
message: resJson.message,
});
calculateBtn.classList.remove("disabledButton");
return;
}
usageResQtyDiv.innerHTML = resJson.used_area.toFixed(2);
Expand Down Expand Up @@ -188,5 +194,6 @@ document.addEventListener("DOMContentLoaded", (event) => {
position: "bottomRight",
title: "Success",
});
calculateBtn.classList.remove("disabledButton");
});
});