1
0
Fork 0
forked from 0x2620/oxjs

Only return Ox.Element if exactly one jquery element is return.

Fixes use of find, children
This commit is contained in:
j 2011-12-29 15:40:08 +05:30
commit ac4dd51ed7
6 changed files with 14 additions and 16 deletions

View file

@ -615,7 +615,7 @@ Ox.TextList = function(options, self) {
function getItem(id) {
//Ox.Log('List', 'getItem', id)
var $item = null;
that.$element.find('.OxItem').each(function() {
that.find('.OxItem').each(function() {
var $this = $(this);
if ($this.data('id') == id) {
$item = $this;
@ -658,7 +658,7 @@ Ox.TextList = function(options, self) {
? $('.OxHeadCell' + stopSelector).next()
: $('.OxHeadCell' + stopSelector));
$resize.detach().insertAfter($column);
that.$body.$element.find('.OxItem').each(function() {
that.$body.find('.OxItem').each(function() {
var $this = $(this);
$this.children(startSelector).detach()[insert](
$this.children(stopSelector)
@ -672,7 +672,7 @@ Ox.TextList = function(options, self) {
self.visibleColumns.splice(stopPos, 0, visibleColumn);
var pos = getColumnPositionById(self.options.columns[self.selectedColumn].id);
if (pos > -1) {
that.$element.find('.OxResize .OxSelected').removeClass('OxSelected');
that.find('.OxResize .OxSelected').removeClass('OxSelected');
pos > 0 && self.$heads[pos].prev().children().eq(2).addClass('OxSelected');
self.$heads[pos].next().children().eq(0).addClass('OxSelected');
if (pos == stopPos) {
@ -697,7 +697,7 @@ Ox.TextList = function(options, self) {
that.$head.$content.empty();
constructHead();
itemWidth = getItemWidth();
that.$body.$element.find('.OxItem').each(function() {
that.$body.find('.OxItem').each(function() {
var $this = $(this);
$this.children(selector).remove();
$this.css({width: itemWidth + 'px'});
@ -738,7 +738,7 @@ Ox.TextList = function(options, self) {
width: width - 9 - (i == self.selectedColumn ? 16 : 0) + 'px'
});
}
that.$element.find('.OxCell.OxColumn' + Ox.toTitleCase(self.options.columns[i].id)).css({
that.find('.OxCell.OxColumn' + Ox.toTitleCase(self.options.columns[i].id)).css({
width: width - (self.options.columnsVisible ? 9 : 8) + 'px'
});
setWidth();