use Ox.break

This commit is contained in:
rolux 2012-05-22 09:11:26 +02:00
commit 04784630d3
42 changed files with 117 additions and 118 deletions

View file

@ -607,10 +607,9 @@ Ox.List = function(options, self) {
// fixme: is this really needed?
var pos = -1;
Ox.forEach(self.$items, function($item, i) {
//Ox.Log('List', '$item', i, self.options.unique, $item.options('data')[self.options.unique])
if ($item.options('data')[self.options.unique] == id) {
pos = i;
return false;
Ox.break();
}
});
return pos;
@ -698,7 +697,7 @@ Ox.List = function(options, self) {
ids.push(self.$items[pos].options('data')[self.options.unique]);
} else {
notFound = true;
return false;
Ox.break();
}
});
if (notFound) {
@ -1156,7 +1155,7 @@ Ox.List = function(options, self) {
if (Ox.toLatin(v.title).toUpperCase().indexOf(str) == 0) {
select(i);
scrollToPosition(i);
return false;
Ox.break();
}
});
}
@ -1343,7 +1342,7 @@ Ox.List = function(options, self) {
if (oldIds.indexOf(item.id) > -1) {
newIds.push(item.id);
}
return newIds.length < oldIds.length;
newIds.length == oldIds.length && Ox.break();
});
setSelected(newIds);
});

View file

@ -259,7 +259,7 @@ Ox.TextList = function(options, self) {
index++;
} else if (v.id == id) {
column = v;
return false;
Ox.break();
}
});
column.visible = true;
@ -283,7 +283,7 @@ Ox.TextList = function(options, self) {
if (!self.options.columns[index].visible) {
addColumn(id);
add = true;
return false;
Ox.break();
}
ids.push(id);
});
@ -291,7 +291,7 @@ Ox.TextList = function(options, self) {
Ox.forEach(self.visibleColumns, function(column) {
if (ids.indexOf(column.id) == -1) {
removeColumn(column.id);
return false;
Ox.break();
}
});
}
@ -484,7 +484,7 @@ Ox.TextList = function(options, self) {
var x = self.drag.listOffset + offset + self.columnWidths[i] / 2;
if (i < self.drag.startPos && e.clientX < x) {
self.drag.stopPos = i;
return false;
Ox.break();
} else if (i > self.drag.startPos && e.clientX > x) {
self.drag.stopPos = i;
}
@ -574,7 +574,7 @@ Ox.TextList = function(options, self) {
if (Ox.startsWith(value, query)) {
that.$body.options({selected: [item[self.unique]]});
Ox.Log('List', 'QUERY', query, 'VALUE', value)
return false;
Ox.break();
}
});
}

View file

@ -33,7 +33,7 @@ Ox.TreeList = function(options, self) {
if (self.options.data) {
self.options.items = [];
Ox.forEach(Ox.sort(Ox.keys(self.options.data)), function(key) {
Ox.sort(Object.keys(self.options.data)).forEach(function(key) {
self.options.items.push(parseData(key, self.options.data[key]));
});
}
@ -123,12 +123,12 @@ Ox.TreeList = function(options, self) {
ret = Ox.extend(item, {
level: level
});
return false;
Ox.break();
}
if (item.items) {
ret = getItemById(id, item.items, level + 1);
if (ret) {
return false;
Ox.break();
}
}
});
@ -145,7 +145,7 @@ Ox.TreeList = function(options, self) {
ret = getParent(id, item.items);
}
if (ret) {
return false;
Ox.break();
}
}
});