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

@ -44,7 +44,12 @@ Ox.DocPanel = function(options, self) {
selected: '',
size: 256
})
.options(options || {});
.options(options || {})
.update({
selected: function() {
selectItem(self.options.selected);
}
});
self.$list = Ox.Element();
self.$page = Ox.Element();
@ -185,12 +190,6 @@ Ox.DocPanel = function(options, self) {
: 0;
}
self.setOption = function(key, value) {
if (key == 'selected') {
selectItem(value);
}
};
return that;
};

View file

@ -22,6 +22,11 @@ Ox.ExamplePanel = function(options, self) {
size: 256
})
.options(options || {})
.update({
selected: function() {
self.$list.options({selected: [self.options.selected]});
}
});
self.$list = Ox.Element();
self.$page = Ox.Element();
@ -122,12 +127,6 @@ Ox.ExamplePanel = function(options, self) {
that.triggerEvent('select', {id: id});
}
self.setOption = function(key, value) {
if (key == 'selected') {
self.$list.options({selected: [value]});
}
};
return that;
};