application.js 1.26 KB
Newer Older
1
$(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
  // Please do not carry these styles over to your projects, it's merely here to prevent button clicks form taking you away from your spot on page
Jacob Thornton's avatar
Jacob Thornton committed
24

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

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


37
38
  // POSITION STATIC TWIPSIES
  // ========================
39

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