Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (18 sloc) 456 Bytes
# jQuery Enabled
# ==============
#
# Shortcuts for enable/disable input elements.
#
# Usage:
#
# $(':submit').enabled(true)
# $(':submit').enabled() # => true
# $(':submit').enabled(false)
# $(':submit').enabled() # => false
# Uncomment this line if you are not using jQuery 1.6+
# jQuery.fn.prop = jQuery.fn.attr if !jQuery.prop
jQuery.fn.enabled = (value) ->
if value is undefined
!@prop('disabled')
else
@prop('disabled', !value)
Something went wrong with that request. Please try again.