luda
Version:
A library helps to build cross-framework UI components.
24 lines (16 loc) • 597 B
text/coffeescript
import '../kernel/index.coffee'
luda.mixin 'disable',
# attr:
# disable: 'readonly | disabled' # optional
# data:
# disable:
# tabIndex: string # required
disableTargetProp: -> ?.disable or 'disabled'
disableCreate: ->
tabIndex = .prop 'tabIndex'
dataAttr = .disable.tabIndex
.data dataAttr, tabIndex unless .hasData dataAttr
.prop('tabIndex', -1).prop , true
disableDestroy: ->
tabIndex = .data .disable.tabIndex
.prop('tabIndex', tabIndex).prop , false