Difference between revisions of "Widget:IIP-Nav"

From Open Energy Information

(change filters to radio buttons)
Line 467: Line 467:
 
   content: "";
 
   content: "";
 
   border: solid 3px;
 
   border: solid 3px;
 +
  border-radius: 50%;
 
   height: 18px;
 
   height: 18px;
 
   width: 18px;
 
   width: 18px;
Line 474: Line 475:
 
}
 
}
 
.filter-modal li.active::before {
 
.filter-modal li.active::before {
   color: #EFAC27;
+
   /*color: #EFAC27;*/
 
   background: #EFAC27;
 
   background: #EFAC27;
 
}
 
}
Line 588: Line 589:
 
   }
 
   }
 
   function applyTopics(event){
 
   function applyTopics(event){
     $(this).parent('li').toggleClass('active');
+
     activeTopics.length = 0; //for use with radio functionality
     activeTopics = [];
+
    if($(this).parent('li').hasClass('active')){
 +
      $(this).parent('li').toggleClass('active');
 +
    } else {
 +
      $('li.active[data-topic]').removeClass('active'); // for use with radio functionality
 +
      $(this).parent('li').toggleClass('active');
 +
     }
 +
    //activeTopics = [];
 
     $('li.active[data-topic]').each(function(){
 
     $('li.active[data-topic]').each(function(){
 
       activeTopics.push($(this).attr('data-topic'));
 
       activeTopics.push($(this).attr('data-topic'));
Line 595: Line 602:
 
     $('#approvals tr[data-topic]').each(function(){
 
     $('#approvals tr[data-topic]').each(function(){
 
       rowTopic = $(this).attr('data-topic');
 
       rowTopic = $(this).attr('data-topic');
       if(activeTopics.indexOf(rowTopic) == -1){
+
       //if(activeTopics.indexOf(rowTopic) == -1){
 +
      if(rowTopic.match(activeTopics) == null){
 
         $(this).removeClass('filteredTopic');
 
         $(this).removeClass('filteredTopic');
 
       } else {
 
       } else {
Line 609: Line 617:
 
   }
 
   }
 
   function applyAgencies(){
 
   function applyAgencies(){
 +
    activeAgencies.length = 0; //for use with radio functionality
 +
    $('li.active[data-agency]').removeClass('active'); //for use with radio functionality
 
     $(this).parent('li').toggleClass('active');
 
     $(this).parent('li').toggleClass('active');
     activeAgencies = [];
+
     //activeAgencies = [];
 
     $('li.active[data-agency]').each(function(){
 
     $('li.active[data-agency]').each(function(){
 
       activeAgencies.push($(this).attr('data-agency'));
 
       activeAgencies.push($(this).attr('data-agency'));

Revision as of 22:51, 30 August 2019

This widget helps with IIP content.

{{#Widget:IIP-Nav}}