From 0a06f4e986134009745f53771a71c2fc21e65562 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 25 May 2016 16:39:17 +0530 Subject: [PATCH] Avoid calling searchAPI more than once The calling code should not be in loop Change-Id: Ib8433115bf9bf18827ad13bcfb3299a846ae98b3 --- src/jquery.uls.languagefilter.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jquery.uls.languagefilter.js b/src/jquery.uls.languagefilter.js index a176353..8b2cc5b 100644 --- a/src/jquery.uls.languagefilter.js +++ b/src/jquery.uls.languagefilter.js @@ -192,13 +192,13 @@ } } } + } - // Also do a search by search API - if ( !this.resultCount && this.options.searchAPI && query ) { - this.searchAPI( query ); - } else { - this.resultHandler( query ); - } + // Also do a search by search API + if ( !this.resultCount && this.options.searchAPI && query ) { + this.searchAPI( query ); + } else { + this.resultHandler( query ); } },