|
6 | 6 | .text-center |
7 | 7 | #graph_metadata{ 'data-type': 'column' } |
8 | 8 |
|
9 | | - %ul.nav.nav-pills.benchmark_navbar |
10 | | - - %w[Headline Other Micro].each_with_index do |category, index| |
11 | | - %li.nav-item |
12 | | - %a.nav-link.activate-chart{ href: '#', 'data-id': category.downcase, class: ('active' if index == 0) }= category |
13 | | - %li.nav-item{ style: 'clear: both; float: left; display: block; position: relative;' } |
| 9 | + %div |
| 10 | + .category_switcher |
| 11 | + - %w[Headline Other Micro].each_with_index do |category, index| |
| 12 | + %button.category_switch.activate-chart{ type: 'button', 'data-id': category.downcase, class: ('active' if index == 0) }= category |
14 | 13 |
|
15 | 14 | - %w[headline other micro].each do |category| |
16 | 15 | .benchmark_graph{ id: category } |
|
116 | 115 | // Switch active tab and render it |
117 | 116 | $('.activate-chart').on('click', function(event) { |
118 | 117 | event.preventDefault(); |
119 | | - $('.benchmark_navbar .nav-link').removeClass('active'); |
| 118 | + $('.category_switch').removeClass('active'); |
120 | 119 | $(this).addClass('active'); |
121 | | - var id = $('.benchmark_navbar .nav-link.active').data('id'); |
| 120 | + var id = $(this).data('id'); |
122 | 121 | var graphElement = $('#' + id); |
123 | 122 | activateChart(graphElement); |
124 | 123 |
|
|
140 | 139 | var url = document.location.toString(); |
141 | 140 | if (url.match('#')) { |
142 | 141 | var id = url.split('#')[1]; |
143 | | - $('.benchmark_navbar .nav-link').removeClass('active'); |
| 142 | + $('.category_switch').removeClass('active'); |
144 | 143 | activateChart($('.benchmark_graph#' + id)); |
145 | 144 | $('.activate-chart[data-id=' + id + ']').addClass('active'); |
146 | 145 | } |
|
0 commit comments