Skip to content

Instantly share code, notes, and snippets.

@dzaporozhets
Created October 3, 2012 13:21
Show Gist options
  • Save dzaporozhets/3826869 to your computer and use it in GitHub Desktop.
Save dzaporozhets/3826869 to your computer and use it in GitHub Desktop.
disable button
(($) ->
# Disable an element and add the 'disabled' Bootstrap class
$.fn.extend disable: ->
$(this).attr('disabled', 'disabled').addClass('disabled')
# Enable an element and remove the 'disabled' Bootstrap class
$.fn.extend enable: ->
$(this).removeAttr('disabled').removeClass('disabled')
)(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment