Skip to content

Commit

Permalink
Fix missing semi colon andt declaerd variabls
Browse files Browse the repository at this point in the history
  • Loading branch information
Awoyalejohn committed Aug 29, 2022
1 parent 145521d commit 5dd19f9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion checkout/static/checkout/js/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://stackoverflow.com/questions/44070437/how-to-get-a-file-or-blob-from-an-url-in-javascript
*/
const downloadItems = document.querySelectorAll('.download-item');
for (let downloadItem of downloadItems ) {
for (const downloadItem of downloadItems ) {
let url = downloadItem.getAttribute('href');

fetch(url)
Expand Down
6 changes: 3 additions & 3 deletions checkout/static/checkout/js/stripe_elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ form.addEventListener('submit', (event) => {
document.querySelector('#submit-button').disabled = true;

// Checks the checkbox if its checked
let saveInfo = document.querySelector('#id-save-info')
let saveInfo = document.querySelector('#id-save-info');
if (typeof (saveInfo) != 'undefined' && saveInfo != null) {
saveInfo = saveInfo.checked;
} else {
Expand All @@ -68,7 +68,7 @@ form.addEventListener('submit', (event) => {
const url = '/checkout/cache_checkout_data/';

//headers
headerInfo = {
const headerInfo = {
'Content-Type': 'application/json',
'X-CSRFToken': csrftoken,
};
Expand Down Expand Up @@ -137,7 +137,7 @@ form.addEventListener('submit', (event) => {
form.submit();
}
}
})
});
})
.catch(function (error) {
// Reloads the page
Expand Down
4 changes: 2 additions & 2 deletions profiles/static/profiles/js/countryfield.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const country = document.querySelector('#id_default_country')
const country = document.querySelector('#id_default_country');
let countrySelected = country.value;

if (!countrySelected) {
Expand All @@ -9,6 +9,6 @@ country.addEventListener('change', (event) => {
if(!countrySelected) {
event.target.style.color = '#aab7c4';
} else{
event.target.style.color = '#000'
event.target.style.color = '#000';
}
});
10 changes: 6 additions & 4 deletions quotes/static/quotes/js/quote_request.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Code to calculate quote request form checkout total when the type and size are selected in the select box
let typeArray = [0];
let sizeArray = [0];
let subtotal = 0
let subtotal = 0;
let subtotalElement = document.querySelector('#subtotal');
let discountPercent = 10
let discountPercent = 10;
let discountElement = document.querySelector('#discount');
let totalElement = document.querySelector('#total');

Expand All @@ -13,6 +13,7 @@ const selectType = document.querySelector('#id_type');
selectType.addEventListener('change', (event) => {
let selectedValue = event.target.value;
let typeCost = null;
let discount = null;

// selects the price based on the current value
if (selectedValue == 'IC' || selectedValue == 'ST') {
Expand All @@ -26,7 +27,7 @@ const selectType = document.querySelector('#id_type');
}

typeArray[0] = typeCost;
subtotal = (typeArray[0] + sizeArray[0]).toFixed(2)
subtotal = (typeArray[0] + sizeArray[0]).toFixed(2);
if (subtotal > 40) {
discount = (subtotal * discountPercent / 100).toFixed(2);
} else {
Expand All @@ -47,6 +48,7 @@ const selectSize = document.querySelector('#id_size');
selectSize.addEventListener('change', (event) => {
let selectedValue = event.target.value;
let sizeCost = null;
let discount = null;

// selects the price based on the current value
if (selectedValue == 'S') {
Expand All @@ -60,7 +62,7 @@ const selectSize = document.querySelector('#id_size');
}

sizeArray[0] = sizeCost;
subtotal = (typeArray[0] + sizeArray[0]).toFixed(2)
subtotal = (typeArray[0] + sizeArray[0]).toFixed(2);
if (subtotal > 40) {
discount = (subtotal * discountPercent / 100).toFixed(2);
} else {
Expand Down
2 changes: 1 addition & 1 deletion quotes/static/quotes/js/stripe_elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ form.addEventListener('submit', (event) => {
form.submit();
}
}
})
});
});

0 comments on commit 5dd19f9

Please sign in to comment.