1
0
Fork 0
forked from 0x2620/oxjs

self.setOption ~> that.update

This commit is contained in:
j 2012-05-28 19:35:41 +00:00
commit 005d50c389
56 changed files with 919 additions and 933 deletions

View file

@ -37,6 +37,27 @@ Ox.Dialog = function(options, self) {
width: 400
})
.options(options || {})
.update({
buttons: setButtons,
content: setContent,
height: function() {
setMinAndMax();
setCSS({height: self.options.height});
},
title: function() {
self.$title.animate({
opacity: 0
}, 50, function() {
self.$title.html(self.options.title).animate({
opacity: 1
}, 50);
});
},
width: function() {
setMinAndMax();
setCSS({width: self.options.width});
}
})
.addClass('OxDialog')
.bindEvent({
key_enter: function() {
@ -606,28 +627,6 @@ Ox.Dialog = function(options, self) {
Ox.Log('Window', 'sMM', self, window.innerHeight, maxRatio)
}
self.setOption = function(key, value) {
if (key == 'buttons') {
setButtons();
} else if (key == 'content') {
setContent();
} else if (key == 'height') {
setMinAndMax();
setCSS({height: value});
} else if (key == 'title') {
self.$title.animate({
opacity: 0
}, 50, function() {
self.$title.html(value).animate({
opacity: 1
}, 50);
});
} else if (key == 'width') {
setMinAndMax();
setCSS({width: value});
}
};
/*@
close <f> close
(callback) -> <o> close