add resize functionality to calendar

This commit is contained in:
rlx 2011-10-03 13:23:40 +00:00
parent 90085aaf2f
commit ea76fed699
2 changed files with 19 additions and 11 deletions

View file

@ -42,8 +42,8 @@ Ox.Calendar = function(options, self) {
.options(options || {})
.addClass('OxCalendar')
.css({
width: self.options.width + 'px',
height: self.options.height + 'px'
//width: self.options.width + 'px',
//height: self.options.height + 'px'
})
.bindEvent({
anyclick: function(e) {
@ -635,11 +635,12 @@ Ox.Calendar = function(options, self) {
}
function getOverlayWidths() {
var width = Math.round(self.options.width / getScrollbarFactor());
var width = that.width() || self.options.width,
centerWidth = Math.round(width / getScrollbarFactor());
return [
Math.floor((self.options.width - width) / 2),
width,
Math.ceil((self.options.width - width) / 2),
Math.floor((width - centerWidth) / 2),
centerWidth,
Math.ceil((width - centerWidth) / 2),
];
}
@ -1034,17 +1035,22 @@ Ox.Calendar = function(options, self) {
if (key == 'date') {
} else if (key == 'height') {
that.css({height: self.options.height + 'px'});
//that.css({height: self.options.height + 'px'});
} else if (key == 'width') {
that.css({width: self.options.width + 'px'});
self.$zoomInput.options({size: self.options.width});
getLines();
renderCalendar();
//that.css({width: self.options.width + 'px'});
//self.$zoomInput.options({size: self.options.width});
//getLines();
} else if (key == 'zoom') {
}
};
that.resizeCalendar = function() {
self.$zoomInput.options({size: that.width()});
getLines();
renderCalendar();
};
return that;
};

View file

@ -87,6 +87,8 @@ Ox.Checkbox = function(options, self) {
self.setOption = function(key, value) {
if (key == 'checked') {
that.toggleChecked();
} else if (key == 'title') {
self.$title.options({title: value});
}
};