add resize functionality to calendar
This commit is contained in:
parent
90085aaf2f
commit
ea76fed699
2 changed files with 19 additions and 11 deletions
|
@ -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;
|
||||
|
||||
};
|
||||
|
|
|
@ -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});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue