From 01056cbc5e9e41b55096c151c65cef7f46cff949 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Tue, 23 Aug 2011 19:58:40 +0000 Subject: [PATCH] some improvements in parseFind --- static/js/pandora/Query.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/Query.js b/static/js/pandora/Query.js index 8835b90..8b66117 100644 --- a/static/js/pandora/Query.js +++ b/static/js/pandora/Query.js @@ -2,7 +2,8 @@ pandora.Query = (function() { function parseFind2(str) { - // takes a string, returns useful information about the application's state + // takes a find query string, returns useful information about the application's state + // (selected lists, find input key/value, group queries and selection, query object) Ox.print('parseFind2', str) str = str || ''; var conditions, @@ -48,9 +49,9 @@ pandora.Query = (function() { if (ret.query.operator == '|') { ret.find = {key: 'advanced', value: ''}; } else { - var conditions = Ox.map(pandora.site.findKeys, function(findKey) { + conditions = Ox.map(pandora.site.findKeys, function(findKey) { var values = oneCondition(ret.query.conditions, findKey.id, ''); - return values.length ? {key: findKey.id, values: values[0]} : null; + return values.length ? {key: findKey.id, values: values} : null; }); ret.find = conditions.length == 0 ? {key: '', value: ''} : conditions.length == 1 && conditions[0].values.length == 1