Total Complexity | 10 |
Complexity/F | 1 |
Lines of Code | 48 |
Function Count | 10 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
2 | * Class that contains methods for hiding and showing elements when needed |
||
3 | */ |
||
4 | export default class classShowHideElements { |
||
5 | /** |
||
6 | * Show the loading spinner |
||
7 | * @returns void |
||
8 | */ |
||
9 | static showLoadingSpinner() { |
||
10 | window.document.getElementById('loadingSpinner')!.classList.remove('hide'); |
||
11 | } |
||
12 | |||
13 | /** |
||
14 | * Hide the loading spinner |
||
15 | * @returns void |
||
16 | */ |
||
17 | static hideLoadingSpinner() { |
||
18 | window.document.getElementById('loadingSpinner')!.classList.add('hide'); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Display the table and add animation class |
||
23 | * @returns void |
||
24 | */ |
||
25 | static showDataTable() { |
||
26 | window.document |
||
27 | .getElementById('tableElement')! |
||
28 | .classList.remove('scale-out'); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Hide the table. Usually caused by an error |
||
33 | * @returns void |
||
34 | */ |
||
35 | static hideDataTable() { |
||
36 | window.document.getElementById('tableElement')!.classList.add('scale-out'); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Hide loading spinner and data table |
||
41 | * @returns void |
||
42 | */ |
||
43 | static hideElements() { |
||
44 | window.document.getElementById('tableElement')!.classList.add('scale-out'); |
||
45 | window.document.getElementById('loadingSpinner')!.classList.add('hide'); |
||
46 | } |
||
47 | } |
||
48 |