From 929ac10071459cdb296186f174abb05c2d6100a3 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 22 May 2012 18:14:34 +0200 Subject: [PATCH] fix a bug in pandora.getFindState --- static/js/pandora/utils.js | 5 +++-- static/js/pandora/viewSelect.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index 30564dbe..fc753cec 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -1245,8 +1245,9 @@ pandora.unloadWindow = function() { return filter.index > -1; }).length; // indices of non-advanced find queries - indices = Ox.indicesOf(pandora.site.findKeys, function(findKey) { - var index = oneCondition(find.conditions, findKey.id, '='); + indices = find.conditions.map(function(condition) { + return oneCondition(find.conditions, condition.key, '='); + }).filter(function(index) { return index > -1; }); state = conditions == 1 && indices.length == 1 ? { diff --git a/static/js/pandora/viewSelect.js b/static/js/pandora/viewSelect.js index b211eefa..14c2e8e8 100644 --- a/static/js/pandora/viewSelect.js +++ b/static/js/pandora/viewSelect.js @@ -7,7 +7,7 @@ pandora.ui.viewSelect = function() { sortKey = !ui.item ? 'listSort' : 'itemSort', viewKey = !ui.item ? 'listView' : 'itemView', items = pandora.site[viewKey + 's'].filter(function(view) { - return ['data', 'files'].indexOf(view.id) == -1; + return view.id != 'data' && view.id != 'files'; }).map(function(view) { return {id: view.id, title: 'View ' + view.title}; }),