Changeset - ea613bccb855
[Not reviewed]
0 1 0
Tobias - 5 years ago 2019-01-21 09:31:51
tobiasschulmann@catalyst.net.nz
Test schedule nav
1 file changed with 10 insertions and 5 deletions:
0 comments (0 inline, 0 general)
pinaxcon/templates/symposion/schedule/schedule_conference.html
Show inline comments
...
 
@@ -91,22 +91,27 @@
 
    'friday': '25'
 
  };
 
  var trailing = ' January 2019';
 
  
 

	
 
  $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
 
    var day = e.target.attributes['aria-controls'].value.split('-');
 
    var controls = e.target.attributes['aria-controls'].value
 
    var day = controls.split('-');
 
    day = day[day.length - 1];
 
    $('#schedule-date').text(day + ' ' + dates[day] + trailing);
 
    var loc = window.location.toString().split('?')[0] += '?schedule=' + controls;
 
    window.history.pushState({path: loc}, '', loc);
 
  })
 
</script>
 

	
 
<script>
 
    const urlParams = new URLSearchParams(window.location.search);
 
    const scheduleName = urlParams.get('schedule');
 
    if (schedule == null) {
 
      var currentName = $('div#schedule-nav').children('a.active').first().attr('aria-controls');
 
      window.location += '?schedule=' + currentName;
 
    } else {
 
    if(scheduleName !== null) {
 
      $('a[href="#' + scheduleName + '"]').tab('show');
 
    } else {
 
      var currLoc = $('a[data-toggle="tab"].active').first().attr('aria-controls');
 
      var loc = window.location.toString().split('?')[0] += '?schedule=' + currLoc;
 
      window.history.replaceState({path: loc}, '', loc);
 
    }
 
  </script>
 
{{ block.super }}
0 comments (0 inline, 0 general)