Skip to content

Commit 0773c71

Browse files
add rough logic paths
1 parent 4506bd4 commit 0773c71

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

src/scripts.js

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ state.parts[0] = 'do-you-know-which-license-you-need/yes/';
2626
state.parts[1] = 'which-license-do-you-need/cc-by';
2727
console.log(state.parts);
2828

29+
state.current = state.parts.join('');
30+
console.log(state.current);
31+
2932
// create state possibilities from possible licenses with adjoining statePaths
3033
state.possibilities = [];
3134
rawStatePathRoutes.forEach((path, index) => {
@@ -58,9 +61,15 @@ applyDefaults.elements = [
5861
'#confirmation'
5962
];
6063
applyDefaults.elements.forEach((element) => {
61-
document.querySelector(element).classList.toggle('disable');
64+
//document.querySelector(element).classList.toggle('disable');
6265
});
6366

67+
if (state.parts[0] == 'do-you-know-which-license-you-need/yes/' ) {
68+
applyDefaults.elements.forEach((element) => {
69+
document.querySelector(element).classList.add('disable');
70+
});
71+
}
72+
6473
fieldsets.forEach((element, index) => {
6574

6675
// [T]: set defaults here first in state.parts dynamically
@@ -95,7 +104,44 @@ fieldsets.forEach((element, index) => {
95104
// let chosenLicense = 'cc-0';
96105
// console.log(chosenLicense);
97106
// }
107+
108+
109+
/////////////////////////////////////////////////////////////
110+
111+
112+
if (state.current == 'do-you-know-which-license-you-need/no/' ) {
113+
114+
applyDefaults.elements.forEach((element) => {
115+
document.querySelector(element).classList.toggle('disable');
116+
});
117+
document.querySelector('#which-license-do-you-need').classList.toggle('disable');
118+
119+
}
120+
121+
if (state.current == 'do-you-know-which-license-you-need/yes/' ) {
122+
123+
applyDefaults.elements.forEach((element) => {
124+
document.querySelector(element).classList.toggle('disable');
125+
});
126+
document.querySelector('#which-license-do-you-need').classList.toggle('disable');
127+
128+
129+
}
130+
98131

99132
});
100133

101134
});
135+
136+
137+
138+
/////////////////////////////////////////////////////////////
139+
140+
// starting assumption
141+
142+
143+
144+
145+
146+
147+

0 commit comments

Comments
 (0)