From 8c7f20a946a1aba6cb48beb0e2ea7f42e4e2547f Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 27 Apr 2019 04:24:34 +0300 Subject: [PATCH] cleanup... Signed-off-by: Alex A. Naanou --- ui (gen4)/lib/widget/browse2.js | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/ui (gen4)/lib/widget/browse2.js b/ui (gen4)/lib/widget/browse2.js index b152564b..8c1c35ca 100755 --- a/ui (gen4)/lib/widget/browse2.js +++ b/ui (gen4)/lib/widget/browse2.js @@ -855,13 +855,6 @@ var BaseBrowserPrototype = { func = args[0] instanceof Function ? args.shift() : undefined - var i = typeof(args[0]) == typeof(123) ? - args.shift() - : 0 - var path = (args[0] instanceof Array - || typeof(args[0]) == typeof('str')) ? - args.shift() - : [] var options = args.pop() || {} options = !options.defaultReverse ? Object.assign({}, @@ -883,8 +876,7 @@ var BaseBrowserPrototype = { // gave us and not the constructed function that we // pass to .walk(..) above... return sublist.map(func, i, path, options) }, - i, - path, + ...args, options) }, @@ -900,13 +892,6 @@ var BaseBrowserPrototype = { func = args[0] instanceof Function ? args.shift() : undefined - var i = typeof(args[0]) == typeof(123) ? - args.shift() - : 0 - var path = (args[0] instanceof Array - || typeof(args[0]) == typeof('str')) ? - args.shift() - : [] var options = args.pop() || {} // XXX better name... @@ -936,11 +921,7 @@ var BaseBrowserPrototype = { // gave us and not the constructed function that we // pass to .walk(..) above... return sublist.search(func, i, path, options) || [] }, - // XXX this is essentially the only place we need parsed arguments... - // ...can we either pass in the args in some standard format - // or spec the format and let walk handle it??? - i, - path, + ...args, options) // nothing found... @@ -1536,11 +1517,13 @@ var BaseBrowserPrototype = { // normal item... : [ renderer.renderItem(item, i, context) ] ) }, function(func, i, path, sublist, options){ - return sublist.render(context, renderer) }, + return sublist.render(context, renderer, i, path) }, // make the element render less strict... function(elem){ return elem && elem.render instanceof Function }, + // pass on i and path if given... + ...[...arguments].slice(2), options) // determine the render mode...