Tags selector back in place

This commit is contained in:
echarp 2016-09-12 00:12:24 +02:00
parent 68f1a50d81
commit ab195d28ae
5 changed files with 75858 additions and 20 deletions

View File

@ -1,13 +1,24 @@
$(document).on 'turbolinks:load', ->
# Quick mechanism so that the ice cube rule only appears when useful
if $('#event_repeat').val() == '0'
$('.field.rule').hide()
# Manage the tags label so it points the proper select2 input
$('label[for=event_tags]').attr 'for', 's2id_autogen1'
$('#event_repeat').change ->
if $(this).val() > 0
$('.field.rule').show()
else
$('.field.rule').hide()
$('#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())
# Quick mechanism so that the ice cube rule only appears when useful
$('#event_repeat').each ->
if $(this).val() == '0'
$('.field.rule').hide()
$(this).change ->
if $(this).val() > 0
$('.field.rule').show()
else
$('.field.rule').hide()
# Manage event tags edition
$('#event_tags').each ->
@ -18,13 +29,3 @@ $(document).on 'turbolinks:load', ->
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=event_tags]').attr 'for', 's2id_autogen1'
$('#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())

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long