R/app_server.R

Defines functions app_server

#' @importFrom shiny callModule
#' @importFrom shinyjs onclick runjs
app_server <- function(input, output, session) {
  onclick('btn-header-plats',
    function(){
      callModule(mod_covid_server, "covid_ui_1")
      runjs("
        document.getElementById('header-menu').querySelector('#btn-header-home').classList.remove('active');
        document.getElementById('btn-header-plats').classList.add('active');
      ")
  })
  
  onclick('btn-header-home',
    function(){
      runjs("
        document.getElementById('header-menu').querySelector('#btn-header-plats').classList.remove('active');
        document.getElementById('btn-header-home').classList.add('active');
      ")
  })
}
guarastats/GuaraDash documentation built on March 31, 2020, 3:37 p.m.