Sha256: b13917b1aa7f85b7bc23f9b1de91d88cd59987fa38a180192d8df19d00e16776
Contents?: true
Size: 928 Bytes
Versions: 10
Compression:
Stored size: 928 Bytes
Contents
$ -> $body = $('body') # init and set active tile $('.tiles').each -> $this = $ this $this.find('.tile').attr('role','button') $this.find('.tile[data-value='+$this.find('input.value, select.value').val()+']').addClass('active') return # tiles $body.on 'click', '.tiles .tile', (e) -> $this = $ this unless $this.hasClass('disabled') tiles = $this.parents('.tiles') tiles.find('.tile').removeClass('active') tiles.find('input.value, select.value').val($this.data('value')).change() $this.addClass('active') e.preventDefault() return false # change active tile on callback $body.on 'change', '.tiles input.value, .tiles select.value', -> $this = $ this tiles = $this.parents('.tiles') tiles.find('.tile').removeClass('active') tiles.find('.tile[data-value='+$this.val()+']').addClass('active') return return
Version data entries
10 entries across 10 versions & 1 rubygems