luda
Version:
A library helps to build cross-framework UI components.
29 lines (18 loc) • 441 B
text/coffeescript
import '../kernel/index.coffee'
luda.component 'enter', document
.protect
selectors: [
'input[type=checkbox]'
'input[type=radio]'
'[tabindex]'
]
.protect
disabled: -> .data('enter') is false
.protect
trigger: (e) ->
return if
return unless luda(e.target).is .join(',')
e.preventDefault()
setTimeout -> e.target.click()
.help
listen: -> [['keydown@enter', ]]