Skip to content

Commit

Permalink
restricting dashstyle function to the home page (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaymeeH authored Nov 21, 2024
1 parent bc0cbaa commit 477b3ab
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions app/javascript/entrypoints/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,34 +246,37 @@ function dashStyle() {
const activity = document.getElementById('dash-activity');
const admin = document.getElementById('dash-admin');
const session = sessionStorage.getItem('dashtab');
const home = document.getElementById('welcome');

// Check the session to see which tab should start as active be active
switch (session) {
case 'classic':
classic.style.borderBottom = 'solid';
classic.style.borderColor = '#E77500';
classic.classList.add('active');
break;
case 'project':
project.style.borderBottom = 'solid';
project.style.borderColor = '#E77500';
project.classList.add('active');
break;
case 'activity':
activity.style.borderBottom = 'solid';
activity.style.borderColor = '#E77500';
activity.classList.add('active');
break;
case 'admin':
admin.style.borderBottom = 'solid';
admin.style.borderColor = '#E77500';
admin.classList.add('active');
break;
default:
classic.style.borderBottom = 'solid';
classic.style.borderColor = '#E77500';
classic.classList.add('active');
break;
if (home) {
switch (session) {
case 'classic':
classic.style.borderBottom = 'solid';
classic.style.borderColor = '#E77500';
classic.classList.add('active');
break;
case 'project':
project.style.borderBottom = 'solid';
project.style.borderColor = '#E77500';
project.classList.add('active');
break;
case 'activity':
activity.style.borderBottom = 'solid';
activity.style.borderColor = '#E77500';
activity.classList.add('active');
break;
case 'admin':
admin.style.borderBottom = 'solid';
admin.style.borderColor = '#E77500';
admin.classList.add('active');
break;
default:
classic.style.borderBottom = 'solid';
classic.style.borderColor = '#E77500';
classic.classList.add('active');
break;
}
}

$('#dash-classic').on('mouseenter', (el) => {
Expand Down

0 comments on commit 477b3ab

Please sign in to comment.