1
0
Fork 0
forked from 0x2620/oxjs

allow for separators in option groups

This commit is contained in:
rlx 2011-11-10 09:54:33 +00:00
commit 08919e7b37
2 changed files with 4 additions and 7 deletions

View file

@ -21,16 +21,11 @@ Ox.OptionGroup = function(items, min, max, property) {
function getLastBefore(pos) {
// returns the position of the last checked item before position pos
var last = -1;
/*Ox.Log('Form', items, items.length, length, Ox.merge(
pos > 0 ? Ox.range(pos - 1, -1, -1) : [],
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : []
))*/
// fixme: why is length not == items.length here?
Ox.forEach(Ox.merge(
pos > 0 ? Ox.range(pos - 1, -1, -1) : [],
pos < items.length - 1 ? Ox.range(items.length - 1, pos, -1) : []
), function(v) {
//Ox.Log('Form', pos, v)
if (items[v][property]) {
last = v;
return false;