Dropdown with date tags in all events

Dropdown with date tags in all events of the schedule
This commit is contained in:
Ana 2016-06-12 21:37:16 +02:00
parent cc031b9f3a
commit 70f30fcb1f
4 changed files with 73 additions and 2 deletions

View file

@ -3,10 +3,10 @@
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<li role="presentation" class="active schedule">
<a title="Timetable of the events" href="#schedule" aria-controls="schedule" role="tab" data-toggle="tab">Schedule</a>
</li>
<li role="presentation">
<li role="presentation" class="program">
<a title="All, including unscheduled Events" href="#program" aria-controls="program" role="tab" data-toggle="tab">All Events</a>
</li>
</ul>
@ -25,3 +25,19 @@
<%= render 'all_events' %>
<% end %>
</div>
<%= javascript_tag do %>
// We set the program tab to active if the url tag starts by 'program-'
$( document ).ready(function() {
if(window.location.hash.substring(1).startsWith('program-')){
schedule = $('.schedule');
schedule.removeClass('active');
schedule.find('a').attr("aria-expanded", "false");
$('#schedule').removeClass('active');
program = $('.program');
program.addClass('active');
program.find('a').attr("aria-expanded", "true");
$('#program').addClass('active');
}
});
<% end %>