Skip to content

Commit 0e142b2

Browse files
No Subtopic Project View
- When user selects the No Subtopic under a topic it will now display projects that are not under a subtopic
1 parent d48ff2c commit 0e142b2

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/projectView.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
async function populateProjects(subtopicID, label){
55
topicSubtopicHeader_el.textContent = label;
66
topicListDiv_el.innerHTML = '';
7-
const filteredProjects = activeProjects.filter(element => parseInt(element.subtopicID) === parseInt(subtopicID))
7+
console.log(activeProjects);
8+
console.log(subtopicID);
9+
const filteredProjects = activeProjects.filter(element => parseInt(element.subtopicID) === parseInt(subtopicID) || element.subtopicID === 'null')
810

911
filteredProjects.forEach(async (element) => {
1012
const projectItemDiv_el = document.createElement('div');

src/subtopicView.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ async function populateSubtopics(topicID, topic) {
1818
const noSubtopicTimeText_el = document.createElement('h3');
1919
noSubtopicTimeText_el.textContent = time;
2020

21+
noSubtopicItem_el.addEventListener('click', async () => {
22+
console.log('No subtopic');
23+
subjectViewLocation = 2;
24+
currentSelectedSubtopic = 'null';
25+
await populateProjects('null', 'Projects');
26+
await populateSpecificQuickTimes('subtopic', 'null');
27+
});
28+
2129
topicListDiv_el.append(noSubtopicItem_el);
2230
noSubtopicItem_el.append(noSubtopicText_el, noSubtopicTimeText_el);
2331

0 commit comments

Comments
 (0)