aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorMichel Etienne2014-08-14 15:48:33 +0200
committerMichel Etienne2014-08-14 15:48:33 +0200
commit11ffb51486eae01f6d9f571155d7afaec8826130 (patch)
tree4ab94fc03249553aed8bb9e3b026c7d7fc7dd37a /app/assets/javascripts
parent8157af57a17b75eb4e710de940b8fe15244bf561 (diff)
downloadchouette-core-11ffb51486eae01f6d9f571155d7afaec8826130.tar.bz2
manage timetable combination modal form with ajax
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/time_tables.js.coffee23
1 files changed, 22 insertions, 1 deletions
diff --git a/app/assets/javascripts/time_tables.js.coffee b/app/assets/javascripts/time_tables.js.coffee
index 71b9ca14f..75889bd3f 100644
--- a/app/assets/javascripts/time_tables.js.coffee
+++ b/app/assets/javascripts/time_tables.js.coffee
@@ -5,7 +5,28 @@ jQuery ->
$('.time_tables .calendars.content').toggle('slow')
$('a.calendars .switcher').toggle()
- $('.time_tables a.calendars').click(switch_calendars)
+ $('.time_tables').on('click','a.calendars',switch_calendars)
+
+ switch_dates = (event) ->
+ event.preventDefault()
+ $('.time_tables .dates.content').toggle('slow')
+ $('a.dates .switcher').toggle()
+
+ $('.time_tables').on('click','a.dates',switch_dates)
+
+ switch_excluded_dates = (event) ->
+ event.preventDefault()
+ $('.time_tables .excluded_dates.content').toggle('slow')
+ $('a.excluded_dates .switcher').toggle()
+
+ $('.time_tables').on('click','a.excluded_dates',switch_excluded_dates)
+
+ switch_periods = (event) ->
+ event.preventDefault()
+ $('.time_tables .periods.content').toggle('slow')
+ $('a.periods .switcher').toggle()
+
+ $('.time_tables').on('click','a.periods',switch_periods)
# add trigger when creating new date or period entries to activate datepicker
tt_datepickerI18n = (index, element) ->