From c262b246d48692e613e5f716eb423688b6d9f15c Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Mon, 24 Feb 2014 16:42:33 +0000 Subject: [PATCH] JavaScript flow fix, fixing comboperson's autocomplete --- Site5/Automation/Json-SearchPeoplePattern.aspx.cs | 5 +++++ Site5/Controls/v5/Swarm/ComboPeople.ascx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Site5/Automation/Json-SearchPeoplePattern.aspx.cs b/Site5/Automation/Json-SearchPeoplePattern.aspx.cs index 21db0a28..6f7056df 100644 --- a/Site5/Automation/Json-SearchPeoplePattern.aspx.cs +++ b/Site5/Automation/Json-SearchPeoplePattern.aspx.cs @@ -23,6 +23,11 @@ namespace Swarmops.Frontend.Automation matches = Authorization.FilterPeopleToMatchAuthority(matches, CurrentUser.GetAuthority()); + if (matches == null) + { + matches = new People(); + } + if (matches.Count > 10) { matches.RemoveRange(10, matches.Count - 10); diff --git a/Site5/Controls/v5/Swarm/ComboPeople.ascx b/Site5/Controls/v5/Swarm/ComboPeople.ascx index ab4957a4..3ddd80c1 100644 --- a/Site5/Controls/v5/Swarm/ComboPeople.ascx +++ b/Site5/Controls/v5/Swarm/ComboPeople.ascx @@ -61,7 +61,8 @@ var autoCompleteLoader = function(param,success,error){ var q = param.q || ''; if (q.length < 3) { - success (null); + success (new Array()); + return false; } $.ajax({ url: '/Automation/Json-SearchPeoplePattern.aspx',