forked from 0x2620/oxjs
allow for separators in option groups
This commit is contained in:
parent
76a79c669d
commit
08919e7b37
2 changed files with 4 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue