summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/extensions/jquery.js.coffee
blob: 0a9db8eb5ef583328cf56fc0b8fedd6233fffe83 (plain)
1
2
3
4
5
6
7
8
9
10
11
# Disable an element and add the 'disabled' Bootstrap class
$.fn.extend disable: ->
  $(@)
    .attr('disabled', 'disabled')
    .addClass('disabled')

# Enable an element and remove the 'disabled' Bootstrap class
$.fn.extend enable: ->
  $(@)
    .removeAttr('disabled')
    .removeClass('disabled')