agenda-libre-ruby/app/assets/javascripts/orgas.js.coffee

14 lines
390 B
CoffeeScript
Raw Normal View History

$(document).ready ->
# Manage orga tags edition
$('#orga_tags').each ->
elt = $(this)
$.ajax
url: '/tags/orgas.json'
.done (data) ->
tags = jQuery.map data, (n) -> n[0]
elt.select2 tags: tags, separator: [' '], tokenSeparators: [' ']
# Manage the tags label so it points the proper select2 input
$('label[for=orga_tags]').attr 'for', 's2id_autogen1'