18 lines
588 B
CoffeeScript
18 lines
588 B
CoffeeScript
$(document).ready ->
|
|
# 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: [' ']
|
|
|
|
$('#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())
|