Sha256: 3d726012b15268df2d4c13de781666aef9b6c91c36086a3aec25ba0b3e11eb1f
Contents?: true
Size: 914 Bytes
Versions: 12
Compression:
Stored size: 914 Bytes
Contents
class CalendarDatesController extends Spine.Module constructor: (element) -> @element = element @initializeDates() initializeDates: () -> for el in @element.find('.date') date = CalendarDate.create( element: $(el) date: $(el).data('date') active: false ) @initializeEventSelect(date) initializeEventSelect: (date) -> date.element.bind('click', () -> date.trigger('activate') CalendarDate.deactivateAllDates() date.updateAttributes(active: true) ) date.bind('activate', (date) -> CalendarEvent.deactivateAllEvents() CalendarEvent.activateAllEventsOn(date.date) ) date.bind('change', (date) -> if date.active == true date.element.addClass('selected') if date.active == false date.element.removeClass('selected') ) window.CalendarDatesController = CalendarDatesController
Version data entries
12 entries across 12 versions & 1 rubygems