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

@ -26,6 +26,30 @@ Ox.InfoList = function(options, self) {
unique: ''
})
.options(options || {})
.update({
items: function() {
that.$element.options('items', self.options.items);
},
selected: function() {
that.$element.options('selected', self.options.selected);
},
sort: function() {
updateKeys();
that.$element.options('sort', self.options.sort);
},
width: function() {
var width = getItemWidth();
$('.OxInfoElement').each(function() {
var $parent = $(this).parent(),
id = parseInt(/OxId(.*?)$/.exec(this.className)[1]);
$parent.css({width: width - 144});
$parent.parent().css({width: width - 144});
$parent.parent().parent().css({width: width - 8});
Ox.Log('List', '@@@', this.className, id)
Ox.UI.elements[id].options({width: width - 152});
});
}
});
//Ox.print('INFO LIST FIND', self.options.find);
@ -154,30 +178,8 @@ Ox.InfoList = function(options, self) {
});
}
self.setOption = function(key, value) {
if (key == 'items') {
that.$element.options(key, value);
} else if (key == 'selected') {
that.$element.options(key, value);
} else if (key == 'sort') {
updateKeys();
that.$element.options(key, value);
} else if (key == 'width') {
var width = getItemWidth();
$('.OxInfoElement').each(function() {
var $parent = $(this).parent(),
id = parseInt(/OxId(.*?)$/.exec(this.className)[1]);
$parent.css({width: width - 144});
$parent.parent().css({width: width - 144});
$parent.parent().parent().css({width: width - 8});
Ox.Log('List', '@@@', this.className, id)
Ox.UI.elements[id].options({width: width - 152});
});
}
};
/*@
closePreivew <f> closePreview
closePreview <f> closePreview
@*/
that.closePreview = function() {
that.$element.closePreview();