summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/extensions/jquery.js
blob: 4978e24949c2624b3d9d082b9e62a8598166c4eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Disable an element and add the 'disabled' Bootstrap class
(function() {
  $.fn.extend({
    disable: function() {
      return $(this).attr('disabled', 'disabled').addClass('disabled');
    }
  });

  // Enable an element and remove the 'disabled' Bootstrap class
  $.fn.extend({
    enable: function() {
      return $(this).removeAttr('disabled').removeClass('disabled');
    }
  });

}).call(this);