aboutsummaryrefslogtreecommitdiff
path: root/docs/assets/js/application.js
blob: 86eefa89d1ce303d0ff366d2049914b28066cd66 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
$(document).ready(function(){

  // Dropdown example for topbar nav
  // ===============================

  $('body').dropdown() // catch any dropdowns on the page


  // table sort example
  // ==================

  $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } )


  // add on logic
  // ============

  $('.add-on :checkbox').click(function () {
    if ($(this).attr('checked')) {
      $(this).parents('.add-on').addClass('active')
    } else {
      $(this).parents('.add-on').removeClass('active')
    }
  })


  // Disable certain links in docs
  // =============================

  $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function (e) {
    e.preventDefault()
  })

  // Copy code blocks in docs
  $(".copy-code").focus(function () {
    var el = this;
    // push select to event loop for chrome :{o
    setTimeout(function () { $(el).select(); }, 1);
  });


  // POSITION STATIC TWIPSIES
  // ========================

  $(".twipsies a").each(function () {
     $(this)
      .twipsy({
        live: false
      , placement: $(this).attr('title')
      , trigger: 'manual'
      , offset: 2
      })
      .trigger('twipsy:show')
    })

});