diff options
author | Christian Franke <nobody@nowhere.ws> | 2016-04-05 15:03:12 -0300 |
---|---|---|
committer | Christian Franke <nobody@nowhere.ws> | 2016-04-05 15:03:12 -0300 |
commit | 4d82c726c39ebca56bde30665f00d728c2d7a20b (patch) | |
tree | 2cb1bbea11d050402d5d722f1bdbff2160c3cf00 | |
parent | 3da396f24ad22cc80e05558deb40c39db1a92295 (diff) |
Dynamically show events on tabcalendar
-rw-r--r-- | public/js/calendar.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/public/js/calendar.js b/public/js/calendar.js index 2f402ae..8818c99 100644 --- a/public/js/calendar.js +++ b/public/js/calendar.js @@ -1,7 +1,27 @@ +var hide_events = function() { + $('.tabcalendar-event-details').hide(); +}; +var show_event = function(event_id) { + hide_events(); + $('.tabcalendar-event-details' + event_id).show(); +}; + $(function() { $('.calendar-listing>p').click(function() { $(this).next().toggle('fast'); return false; }).next().hide(); + $('.tabcal-cell a').each(function(i,a) { + var hashpos = a.href.indexOf('#'); + if (haspos < 0) + return true; + var hash = a.href.slice(hashpos); + if (!hash.startsWith('#event-')) + return true; + a.click(function() { + show_event(hash); + return false; + }); + }); + hide_events(); }); - |