aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/helpers/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/helpers/utils.ts')
-rw-r--r--client/src/app/helpers/utils.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts
index edcaf50e0..8636f3a55 100644
--- a/client/src/app/helpers/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -10,7 +10,7 @@ import { AuthService } from '../core/auth'
10// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript 10// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
11function getParameterByName (name: string, url: string) { 11function getParameterByName (name: string, url: string) {
12 if (!url) url = window.location.href 12 if (!url) url = window.location.href
13 name = name.replace(/[\[\]]/g, '\\$&') 13 name = name.replace(/[[\]]/g, '\\$&')
14 14
15 const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)') 15 const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)')
16 const results = regex.exec(url) 16 const results = regex.exec(url)
@@ -110,10 +110,10 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) {
110 continue 110 continue
111 } 111 }
112 112
113 if (obj[key] !== null && typeof obj[ key ] === 'object' && !(obj[ key ] instanceof File)) { 113 if (obj[key] !== null && typeof obj[key] === 'object' && !(obj[key] instanceof File)) {
114 objectToFormData(obj[ key ], fd, formKey) 114 objectToFormData(obj[key], fd, formKey)
115 } else { 115 } else {
116 fd.append(formKey, obj[ key ]) 116 fd.append(formKey, obj[key])
117 } 117 }
118 } 118 }
119 119
@@ -159,7 +159,7 @@ function scrollToTop (behavior: 'auto' | 'smooth' = 'auto') {
159function isInViewport (el: HTMLElement) { 159function isInViewport (el: HTMLElement) {
160 const bounding = el.getBoundingClientRect() 160 const bounding = el.getBoundingClientRect()
161 return ( 161 return (
162 bounding.top >= 0 && 162 bounding.top >= 0 &&
163 bounding.left >= 0 && 163 bounding.left >= 0 &&
164 bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && 164 bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
165 bounding.right <= (window.innerWidth || document.documentElement.clientWidth) 165 bounding.right <= (window.innerWidth || document.documentElement.clientWidth)