forked from 0x2620/oxjs
some redesign for better garbage collection of elements
This commit is contained in:
parent
01f02d9730
commit
1d09d19423
17 changed files with 129 additions and 101 deletions
|
|
@ -33,16 +33,17 @@ Ox.ListItem = function(options, self) {
|
|||
|
||||
function constructItem(update) {
|
||||
var $element = self.options.construct(self.options.data)
|
||||
.addClass('OxItem')
|
||||
.addClass('OxItem LISTITEM')
|
||||
.data({
|
||||
id: self.options.data[self.options.unique],
|
||||
position: self.options.position
|
||||
});
|
||||
if (update) {
|
||||
that.$element.hasClass('OxSelected') && $element.addClass('OxSelected');
|
||||
that.$element.replaceWith($element);
|
||||
//that.$element.replaceWith($element);
|
||||
}
|
||||
that.$element = $element;
|
||||
//that.$element = $element;
|
||||
that.setElement($element);
|
||||
}
|
||||
|
||||
self.setOption = function(key, value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue