application.js 1.19 KB
Newer Older
Jacob Thornton's avatar
Jacob Thornton committed
1
$(document).ready(function(){
2

Jacob Thornton's avatar
Jacob Thornton committed
3
4
5
6
7
8
  // Scrollspy
  // =========

  $('body > .topbar').scrollSpy()


9
  // table sort example
Jacob Thornton's avatar
Jacob Thornton committed
10
11
  // ==================

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

Jacob Thornton's avatar
Jacob Thornton committed
14
15
16
17

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

18
  $('.add-on :checkbox').click(function () {
19
    if ($(this).attr('checked')) {
20
      $(this).parents('.add-on').addClass('active')
21
    } else {
22
      $(this).parents('.add-on').removeClass('active')
23
    }
24
  })
Jacob Thornton's avatar
Jacob Thornton committed
25

Jacob Thornton's avatar
Jacob Thornton committed
26

27
  // Disable certain links in docs
Jacob Thornton's avatar
Jacob Thornton committed
28
29
  // =============================

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

34
  // Copy code blocks in docs
35
  $(".copy-code").focus(function () {
Jacob Thornton's avatar
Jacob Thornton committed
36
37
38
    var el = this;
    // push select to event loop for chrome :{o
    setTimeout(function () { $(el).select(); }, 1);
39
40
41
  });


42
43
  // POSITION STATIC TWIPSIES
  // ========================
44

45
46
47
48
49
50
51
52
53
54
  $(window).load(function () {
    $(".twipsies a").each(function () {
       $(this)
        .twipsy({
          live: false
        , placement: $(this).attr('title')
        , trigger: 'manual'
        , offset: 2
        })
        .trigger('twipsy:show')
55
      })
56
  })
57
});