Skip to content

Instantly share code, notes, and snippets.

@eduardolundgren
Created April 12, 2012 19:07
Show Gist options
  • Save eduardolundgren/2370194 to your computer and use it in GitHub Desktop.
Save eduardolundgren/2370194 to your computer and use it in GitHub Desktop.
A.SchedulerEvent = A.Component.create({
NAME: 'scheduler-event',
ATTRS: {
allDay: {
value: false,
validator: isBoolean
},
calendarId: {
value: 0,
setter: toNumber
},
calendarBookingId: {
value: 0,
setter: toNumber
},
description: {
value: '',
validator: isString
},
loading: {
value: false,
validator: isBoolean
},
location: {
value: '',
validator: isString
},
parentCalendarBookingId: {
value: 0,
setter: toNumber
}
},
EXTENDS: A.SchedulerEvent,
prototype: {
initializer: function() {
var instance = this;
instance._uiSetLoading(
instance.get('loading')
);
instance.on('loadingChange', instance._onLoadingChange);
},
_onLoadingChange: function(event) {
var instance = this;
instance._uiSetLoading(event.newVal);
},
_uiSetLoading: function(val) {
var instance = this;
instance.get('node').toggleClass('calendar-portlet-event-loading', val);
instance.get('paddingNode').toggleClass('calendar-portlet-event-loading', val);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment