forked from 0x2620/oxjs
self.setOption ~> that.update
This commit is contained in:
parent
9ee0742b53
commit
005d50c389
56 changed files with 919 additions and 933 deletions
|
|
@ -44,6 +44,42 @@ Ox.Calendar = function(options, self) {
|
|||
zoomOnlyWhenFocused: false
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
date: function() {
|
||||
// ...
|
||||
},
|
||||
events: function() {
|
||||
self.options.events.forEach(function(event) {
|
||||
event = getEventData(event);
|
||||
});
|
||||
self.$lines = [];
|
||||
getLines();
|
||||
renderCalendar();
|
||||
if (self.options.selected) {
|
||||
selectEvent(
|
||||
getSelectedEvent() ? self.options.selected : ''
|
||||
);
|
||||
}
|
||||
},
|
||||
height: function() {
|
||||
that.css({height: self.options.height + 'px'});
|
||||
},
|
||||
selected: function() {
|
||||
var selected = self.options.selected;
|
||||
// deselect would not work if self.options.selected was already empty
|
||||
self.options.selected = 'FIXME: THIS IS A VERY UGLY HACK';
|
||||
selectEvent(selected);
|
||||
},
|
||||
width: function() {
|
||||
that.css({width: self.options.width + 'px'});
|
||||
self.options.showZoombar && self.$zoomInput.options({size: self.options.width});
|
||||
renderOverlay();
|
||||
//getLines();
|
||||
},
|
||||
zoom: function() {
|
||||
// ...
|
||||
}
|
||||
})
|
||||
.addClass('OxCalendar')
|
||||
/*
|
||||
.css({
|
||||
|
|
@ -1225,36 +1261,6 @@ Ox.Calendar = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'date') {
|
||||
// ...
|
||||
} else if (key == 'events') {
|
||||
value.forEach(function(event) {
|
||||
event = getEventData(event);
|
||||
});
|
||||
self.$lines = [];
|
||||
getLines();
|
||||
renderCalendar();
|
||||
if (self.options.selected) {
|
||||
selectEvent(
|
||||
getSelectedEvent() ? self.options.selected : ''
|
||||
);
|
||||
}
|
||||
} else if (key == 'height') {
|
||||
that.css({height: self.options.height + 'px'});
|
||||
} else if (key == 'selected') {
|
||||
self.options.selected = 'FIXME: THIS IS A VERY UGLY HACK';
|
||||
selectEvent(value);
|
||||
} else if (key == 'width') {
|
||||
that.css({width: self.options.width + 'px'});
|
||||
self.options.showZoombar && self.$zoomInput.options({size: self.options.width});
|
||||
renderOverlay();
|
||||
//getLines();
|
||||
} else if (key == 'zoom') {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/*@
|
||||
that.addEvent <f> addEvent
|
||||
(event) -> <o> object
|
||||
|
|
|
|||
|
|
@ -28,6 +28,16 @@ Ox.ListCalendar = function(options, self) {
|
|||
width: 256
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
height: function() {
|
||||
// fixme: should be .resizeList
|
||||
self.$list.size();
|
||||
self.$calendar.resizeCalendar();
|
||||
},
|
||||
width: function() {
|
||||
self.$calendar.resizeCalendar();
|
||||
}
|
||||
})
|
||||
.css({
|
||||
width: self.options.width + 'px',
|
||||
height: self.options.height + 'px'
|
||||
|
|
@ -807,16 +817,6 @@ Ox.ListCalendar = function(options, self) {
|
|||
self.$list.options({items: events});
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'height') {
|
||||
// fixme: should be .resizeList
|
||||
self.$list.size();
|
||||
self.$calendar.resizeCalendar();
|
||||
} else if (key == 'width') {
|
||||
self.$calendar.resizeCalendar();
|
||||
}
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue