summaryrefslogtreecommitdiff
blob: 0a92a55cc539dfddcbf5e9c52acbe254baf0d61a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$(function() {
  var table = $('.ag-header-table');

  if (table === undefined) {
    return;
  }

  if ($('.ag-quote').size() === 0) {
    return;
  }

  var btn = $("<button class=\"btn btn-xs btn-default hidden-xs ag-toggle-quotes\"><span class=\"fa fa-quote-left\"></span> Toggle quotes</button>");
  btn.insertAfter(table);
  btn.click(function() {
    $('.ag-quote').each(function(index) {
      $(this).toggleClass('ag-quote-hidden');
    });
  });

  $('.ag-quote').each(function(index) {
    // Don't hide quotes by default. Maybe put in some cookie stuff to remember the choice
    // $(this).addClass('ag-quote-hidden');

    $(this).click(function() {
      $('.ag-quote').each(function(index) {
        $(this).toggleClass('ag-quote-hidden');
      });
    });
  });
});