mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
bugfix + refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
db078e072a
commit
d1ca404feb
@ -352,27 +352,11 @@ var BaseBrowserPrototype = {
|
||||
//
|
||||
// visible only...
|
||||
get length(){
|
||||
return this.map({skipNested: true}).length
|
||||
// XXX this is wrong as it will not account for nested nested elements...
|
||||
+ this.nested()
|
||||
.reduce(function(res, e){
|
||||
return e.collapsed ?
|
||||
res + 1
|
||||
: res + e.children.length }, 0) },
|
||||
// tree -- ignores .collapsed...
|
||||
return this.map().length },
|
||||
get lengthTree(){
|
||||
return this.map({skipNested: true}).length
|
||||
// XXX this is wrong as it will not account for nested nested elements...
|
||||
+ this.nested()
|
||||
.reduce(function(res, e){
|
||||
return res + e.children.length }, 0) },
|
||||
// full -- ignores .collapsed and .noniterable...
|
||||
return this.map({iterateCollapsed: true}).length },
|
||||
get lengthAll(){
|
||||
return this.map({skipNested: true, iterateNonIterable: true}).length
|
||||
// XXX this is wrong as it will not account for nested nested elements...
|
||||
+ this.nested()
|
||||
.reduce(function(res, e){
|
||||
return res + (e.children.lengthAll || e.children.length) }, 0) },
|
||||
return this.map({iterateAll: true}).length },
|
||||
|
||||
|
||||
// Item list constructor...
|
||||
@ -925,10 +909,12 @@ var BaseBrowserPrototype = {
|
||||
return nested }
|
||||
|
||||
// normalize...
|
||||
list = (list === true || list == null) ?
|
||||
list = list === true ?
|
||||
children
|
||||
: (!iterateCollapsed && node.collapsed) ?
|
||||
[]
|
||||
: list == null ?
|
||||
children
|
||||
: list
|
||||
|
||||
// call .walk2(..) recursively...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user