Skip to content

Commit

Permalink
rename variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
Asif798 committed Feb 14, 2022
1 parent 3f2c774 commit c07e309
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
16 changes: 8 additions & 8 deletions resources/scripts/admin/views/estimates/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function hasActiveUrl(id) {
return route.params.id == id
}
async function loadEstimates(params, isScroll = false) {
async function loadEstimates(params, fromScrollListener = false) {
if (isLoading.value) {
return
}
Expand All @@ -376,21 +376,21 @@ async function loadEstimates(params, isScroll = false) {
currentPageNumber.value = params ? params.page : 1
lastPageNumber.value = response.data.meta.last_page
let isEstimateExist = estimateList.value.find(
let estimateFound = estimateList.value.find(
(est) => est.id == route.params.id
)
if (
isScroll == false &&
!isEstimateExist &&
fromScrollListener == false &&
!estimateFound &&
currentPageNumber.value < lastPageNumber.value
) {
loadEstimates({ page: ++currentPageNumber.value })
}
if (isEstimateExist) {
if (estimateFound) {
setTimeout(() => {
if (isScroll == false) {
if (fromScrollListener == false) {
scrollToEstimate()
}
}, 500)
Expand All @@ -402,11 +402,11 @@ function scrollToEstimate() {
if (el) {
el.scrollIntoView({ behavior: 'smooth' })
el.classList.add('shake')
addScrollListner()
addScrollListener()
}
}
function addScrollListner() {
function addScrollListener() {
estimateListSection.value.addEventListener('scroll', (ev) => {
if (
ev.target.scrollTop > 0 &&
Expand Down
10 changes: 5 additions & 5 deletions resources/scripts/admin/views/expenses/Create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,8 @@ function onCurrencyChange(v) {
async function searchCategory(search) {
let res = await categoryStore.fetchCategories({ search })
if(res.data.data.length>0 && categoryStore.editCategory) {
let checkCategoryExist = res.data.data.find((c) => c.id==categoryStore.editCategory.id)
if(!checkCategoryExist) {
let categoryFound = res.data.data.find((c) => c.id==categoryStore.editCategory.id)
if(!categoryFound) {
let edit_category = Object.assign({}, categoryStore.editCategory)
res.data.data.unshift(edit_category)
}
Expand All @@ -428,8 +428,8 @@ async function searchCategory(search) {
async function searchCustomer(search) {
let res = await customerStore.fetchCustomers({ search })
if(res.data.data.length>0 && customerStore.editCustomer) {
let checkCustomerExist = res.data.data.find((c) => c.id==customerStore.editCustomer.id)
if(!checkCustomerExist) {
let customerFound = res.data.data.find((c) => c.id==customerStore.editCustomer.id)
if(!customerFound) {
let edit_customer = Object.assign({}, customerStore.editCustomer)
res.data.data.unshift(edit_customer)
}
Expand Down Expand Up @@ -463,7 +463,7 @@ async function loadData() {
customerStore.editCustomer = expenseData.data.data.customer
}
}
} else if (route.query.customer) {
expenseStore.currentExpense.customer_id = route.query.customer
}
Expand Down
16 changes: 8 additions & 8 deletions resources/scripts/admin/views/invoices/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function hasActiveUrl(id) {
return route.params.id == id
}
async function loadInvoices(params, isScroll = false) {
async function loadInvoices(params, fromScrollListener = false) {
if (isLoading.value) {
return
}
Expand All @@ -125,21 +125,21 @@ async function loadInvoices(params, isScroll = false) {
currentPageNumber.value = params ? params.page : 1
lastPageNumber.value = response.data.meta.last_page
let isInvoiceExist = invoiceList.value.find(
let invoiceFound = invoiceList.value.find(
(inv) => inv.id == route.params.id
)
if (
isScroll == false &&
!isInvoiceExist &&
fromScrollListener == false &&
!invoiceFound &&
currentPageNumber.value < lastPageNumber.value
) {
loadInvoices({ page: ++currentPageNumber.value })
}
if (isInvoiceExist) {
if (invoiceFound) {
setTimeout(() => {
if (isScroll == false) {
if (fromScrollListener == false) {
scrollToInvoice()
}
}, 500)
Expand All @@ -151,11 +151,11 @@ function scrollToInvoice() {
if (el) {
el.scrollIntoView({ behavior: 'smooth' })
el.classList.add('shake')
addScrollListner()
addScrollListener()
}
}
function addScrollListner() {
function addScrollListener() {
invoiceListSection.value.addEventListener('scroll', (ev) => {
if (
ev.target.scrollTop > 0 &&
Expand Down
16 changes: 8 additions & 8 deletions resources/scripts/admin/views/payments/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function hasAbilities() {
const dialogStore = useDialogStore()
async function loadPayments(params, isScroll = false) {
async function loadPayments(params, fromScrollListener = false) {
if (isLoading.value) {
return
}
Expand All @@ -352,21 +352,21 @@ async function loadPayments(params, isScroll = false) {
currentPageNumber.value = params ? params.page : 1
lastPageNumber.value = response.data.meta.last_page
let isPaymentExist = paymentList.value.find(
let paymentFound = paymentList.value.find(
(paym) => paym.id == route.params.id
)
if (
isScroll == false &&
!isPaymentExist &&
fromScrollListener == false &&
!paymentFound &&
currentPageNumber.value < lastPageNumber.value
) {
loadPayments({ page: ++currentPageNumber.value })
}
if (isPaymentExist) {
if (paymentFound) {
setTimeout(() => {
if (isScroll == false) {
if (fromScrollListener == false) {
scrollToPayment()
}
}, 500)
Expand All @@ -392,11 +392,11 @@ function scrollToPayment() {
if (el) {
el.scrollIntoView({ behavior: 'smooth' })
el.classList.add('shake')
addScrollListner()
addScrollListener()
}
}
function addScrollListner() {
function addScrollListener() {
paymentListSection.value.addEventListener('scroll', (ev) => {
if (
ev.target.scrollTop > 0 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function hasActiveUrl(id) {
return route.params.id == id
}
async function loadRecurringInvoices(params, isScroll = false) {
async function loadRecurringInvoices(params, fromScrollListener = false) {
if (isLoading.value) {
return
}
Expand All @@ -52,21 +52,21 @@ async function loadRecurringInvoices(params, isScroll = false) {
currentPageNumber.value = params ? params.page : 1
lastPageNumber.value = response.data.meta.last_page
let isInvoiceExist = invoiceList.value.find(
let invoiceFound = invoiceList.value.find(
(inv) => inv.id == route.params.id
)
if (
isScroll == false &&
!isInvoiceExist &&
fromScrollListener == false &&
!invoiceFound &&
currentPageNumber.value < lastPageNumber.value
) {
loadRecurringInvoices({ page: ++currentPageNumber.value })
}
if (isInvoiceExist) {
if (invoiceFound) {
setTimeout(() => {
if (isScroll == false) {
if (fromScrollListener == false) {
scrollToRecurringInvoice()
}
}, 500)
Expand All @@ -78,11 +78,11 @@ function scrollToRecurringInvoice() {
if (el) {
el.scrollIntoView({ behavior: 'smooth' })
el.classList.add('shake')
addScrollListner()
addScrollListener()
}
}
function addScrollListner() {
function addScrollListener() {
invoiceListSection.value.addEventListener('scroll', (ev) => {
if (
ev.target.scrollTop > 0 &&
Expand Down
4 changes: 2 additions & 2 deletions resources/scripts/components/base/BaseCustomerSelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ async function searchCustomers(search) {
let res = await customerStore.fetchCustomers(data)
if(res.data.data.length>0 && customerStore.editCustomer) {
let checkCustomerExist = res.data.data.find((c) => c.id==customerStore.editCustomer.id)
if(!checkCustomerExist) {
let customerFound = res.data.data.find((c) => c.id==customerStore.editCustomer.id)
if(!customerFound) {
let edit_customer = Object.assign({}, customerStore.editCustomer)
res.data.data.unshift(edit_customer)
}
Expand Down

0 comments on commit c07e309

Please sign in to comment.