2013-12-29 00:23:08 +01:00
|
|
|
$(document).ready ->
|
2014-08-16 11:19:27 +02:00
|
|
|
# Manage event tags edition
|
|
|
|
$('#event_tags').each ->
|
|
|
|
elt = $(this)
|
|
|
|
$.ajax
|
|
|
|
url: '/tags.json'
|
|
|
|
.done (data) ->
|
|
|
|
tags = jQuery.map data, (n) -> n[0]
|
|
|
|
|
|
|
|
elt.select2 tags: tags, separator: [' '], tokenSeparators: [' ']
|
|
|
|
|
2014-09-23 17:50:35 +02:00
|
|
|
$('#event_start_time').change ->
|
|
|
|
if $('#event_start_time').val() >= $('#event_end_time').val()
|
|
|
|
$('#event_end_time').val($('#event_start_time').val())
|
|
|
|
$('#event_end_time').change ->
|
|
|
|
if $('#event_start_time').val() >= $('#event_end_time').val()
|
|
|
|
$('#event_start_time').val($('#event_end_time').val())
|
2014-12-14 21:45:41 +01:00
|
|
|
|
|
|
|
# Manage the tags label so it points the proper select2 input
|
2014-12-23 18:56:49 +01:00
|
|
|
$('label[for=event_tags]').attr 'for', 's2id_autogen1'
|