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

3
  // table sort example
Jacob Thornton's avatar
Jacob Thornton committed
4
5
  // ==================

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

Jacob Thornton's avatar
Jacob Thornton committed
8
9
10
11

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

12
  $('.add-on :checkbox').click(function () {
13
    if ($(this).attr('checked')) {
14
      $(this).parents('.add-on').addClass('active')
15
    } else {
16
      $(this).parents('.add-on').removeClass('active')
17
    }
18
  })
Jacob Thornton's avatar
Jacob Thornton committed
19

Jacob Thornton's avatar
Jacob Thornton committed
20

21
  // Disable certain links in docs
Jacob Thornton's avatar
Jacob Thornton committed
22
23
  // =============================

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

28
  // Copy code blocks in docs
29
  $(".copy-code").focus(function () {
Jacob Thornton's avatar
Jacob Thornton committed
30
31
32
    var el = this;
    // push select to event loop for chrome :{o
    setTimeout(function () { $(el).select(); }, 1);
33
34
35
  });


36
37
  // POSITION STATIC TWIPSIES
  // ========================
38

39
40
41
42
43
44
45
46
47
  $(window).load(function () {
    $(".twipsies a").each(function () {
       $(this)
        .twipsy({
          live: false
        , placement: $(this).attr('title')
        , trigger: 'manual'
        , offset: 2
        })
48
        .twipsy('show')
49
      })
50
  })
51
});