Skip to content

Commit

Permalink
Update forecast_mhw.js
Browse files Browse the repository at this point in the history
Adding js functionality to new mobile tabs
  • Loading branch information
KevinCounts authored Oct 4, 2024
1 parent 2a58ca6 commit 45a313b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions forecast_mhw.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ $("#"+dashDropDownID).on("change", function(){
// change the active navpil
$("#"+dashNavPillID+" > ul.nav-pills > li.nav-item").removeClass("active");
$("#"+selectedValue.slice(0, -3)+'Pill').addClass("active");
// change the active navtab
$("#"+dashNavPillID+" > ul.nav-tabs > li.nav-item").removeClass("active");
$("#"+selectedValue.slice(0, -3)+'Tab').addClass("active");
// change the active navpil content
$("#"+dashContentID+" div.tab-pane").removeClass("active");
$("#"+selectedValue.slice(0, -3)).addClass("active");
Expand All @@ -152,6 +155,14 @@ $("#"+dashNavPillID+" > ul.nav-pills > li.nav-item > .nav-link").on('click',func
let hrefIDText = hrefID.slice(1)
// reuse changeDashSelect (historical.js)
window.changeDashSelect(dashDropDownID,hrefIDText+'Val')
});

// event listener for navtab being clicked
$("#"+dashNavPillID+" > ul.nav-tabs > li.nav-item > .nav-link").on('click',function(){
let hrefID = $(this).attr('href')
let hrefIDText = hrefID.slice(1)
// reuse changeDashSelect (historical.js)
window.changeDashSelect(dashDropDownID,hrefIDText+'Val')
});

// event listener for the "message" event when map location click
Expand Down

0 comments on commit 45a313b

Please sign in to comment.