fix regressions introduced by garbage collection

This commit is contained in:
rlx 2011-11-05 11:44:31 +00:00
parent 1d09d19423
commit 2df5d05980
3 changed files with 11 additions and 7 deletions

View file

@ -376,8 +376,10 @@ Ox.Element = function(options, self) {
}; };
that.setElement = function($element) { that.setElement = function($element) {
that.$element.replaceWith(that.$element = $element); //$element[0].className = that.$element[0].className;
that.$element.data({oxid: that.id}); $element.addClass('OxElement').data({oxid: that.id});
that.$element.replaceWith($element);
that.$element = $element;
that[0] = that.$element[0]; that[0] = that.$element[0];
}; };

View file

@ -40,10 +40,11 @@ Ox.ListItem = function(options, self) {
}); });
if (update) { if (update) {
that.$element.hasClass('OxSelected') && $element.addClass('OxSelected'); that.$element.hasClass('OxSelected') && $element.addClass('OxSelected');
//that.$element.replaceWith($element); // that.$element.replaceWith($element);
} }
//that.$element = $element; // that.$element = $element;
that.setElement($element); that.setElement($element);
Ox.print('LISTITEM', that.$element.data('id'))
} }
self.setOption = function(key, value) { self.setOption = function(key, value) {

View file

@ -588,7 +588,7 @@ Ox.TextList = function(options, self) {
function getCell(id, key) { function getCell(id, key) {
Ox.Log('List', 'getCell', id, key) Ox.Log('List', 'getCell', id, key)
var $item = getItem(id); var $item = getItem(id);
key = key || ''; key = key || ''; // fixme: what is this?
return $($item.find('.OxCell.OxColumn' + Ox.toTitleCase(key))[0]); return $($item.find('.OxCell.OxColumn' + Ox.toTitleCase(key))[0]);
} }
@ -611,7 +611,7 @@ Ox.TextList = function(options, self) {
function getItem(id) { function getItem(id) {
//Ox.Log('List', 'getItem', id) //Ox.Log('List', 'getItem', id)
var $item = null; var $item = null;
that.find('.OxItem').each(function() { that.$element.find('.OxItem').each(function() {
$this = $(this); $this = $(this);
if ($this.data('id') == id) { if ($this.data('id') == id) {
$item = $this; $item = $this;
@ -737,12 +737,13 @@ Ox.TextList = function(options, self) {
that.$element.find('.OxCell.OxColumn' + Ox.toTitleCase(self.options.columns[i].id)).css({ that.$element.find('.OxCell.OxColumn' + Ox.toTitleCase(self.options.columns[i].id)).css({
width: width - (self.options.columnsVisible ? 9 : 8) + 'px' width: width - (self.options.columnsVisible ? 9 : 8) + 'px'
}); });
Ox.Log('??? resize column')
setWidth(); setWidth();
} }
function setWidth() { function setWidth() {
var width = getItemWidth(); var width = getItemWidth();
that.$body.$content.find('.OxItem').css({ // fixme: can we avoid this lookup? that.$body.$content.$element.find('.OxItem').css({ // fixme: can we avoid this lookup?
width: width + 'px' width: width + 'px'
}); });
that.$body.$content.css({ that.$body.$content.css({