forked from 0x2620/oxjs
minor fixes
This commit is contained in:
parent
ee93ed673e
commit
1083a324dc
3 changed files with 34 additions and 26 deletions
|
|
@ -46,10 +46,6 @@ Ox.Dialog = function(options, self) {
|
|||
|
||||
self.hasButtons = !!self.options.buttons.length;
|
||||
self.barsHeight = 24 + 24 * self.hasButtons;
|
||||
self.initialHeight = self.options.height;
|
||||
self.initialWidth = self.options.width;
|
||||
self.initialMaxHeight = self.options.maxHeight;
|
||||
self.initialMaxWidth = self.options.maxWidth;
|
||||
self.titleMargin = 8 + (self.options.closeButton ? 20 : 0)
|
||||
+ (self.options.maximizeButton ? 20 : 0);
|
||||
|
||||
|
|
@ -595,6 +591,9 @@ Ox.Dialog = function(options, self) {
|
|||
self.setOption = function(key, value) {
|
||||
if (key == 'content') {
|
||||
setContent();
|
||||
} else if (key == 'height') {
|
||||
setMinAndMax();
|
||||
setCSS({height: value});
|
||||
} else if (key == 'title') {
|
||||
self.$title.animate({
|
||||
opacity: 0
|
||||
|
|
@ -603,6 +602,9 @@ Ox.Dialog = function(options, self) {
|
|||
opacity: 1
|
||||
}, 50);
|
||||
});
|
||||
} else if (key == 'height') {
|
||||
setMinAndMax();
|
||||
setCSS({width: value});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -623,6 +625,7 @@ Ox.Dialog = function(options, self) {
|
|||
that.loseFocus();
|
||||
Ox.UI.$window.unbind({mouseup: mouseupLayer});
|
||||
}
|
||||
that.triggerEvent('close');
|
||||
return that;
|
||||
};
|
||||
|
||||
|
|
@ -631,6 +634,10 @@ Ox.Dialog = function(options, self) {
|
|||
};
|
||||
|
||||
that.open = function() {
|
||||
self.initialHeight = self.options.height;
|
||||
self.initialWidth = self.options.width;
|
||||
self.initialMaxHeight = self.options.maxHeight;
|
||||
self.initialMaxWidth = self.options.maxWidth;
|
||||
setMinAndMax();
|
||||
center();
|
||||
reset();
|
||||
|
|
@ -666,6 +673,8 @@ Ox.Dialog = function(options, self) {
|
|||
self.options.height = height;
|
||||
setMinAndMax();
|
||||
if (self.maximized) {
|
||||
self.originalWidth = width;
|
||||
self.originalHeight = height;
|
||||
self.options.width = self.options.maxWidth;
|
||||
self.options.height = self.options.maxHeight;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue