Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove dependency on AjaxSolr.size

  • Loading branch information...
commit f5cacf206524851073a1890ca6bbcf1a5a98093a 1 parent aa5ad4b
@jpmckinney jpmckinney authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 core/AbstractSpellcheckWidget.js
View
6 core/AbstractSpellcheckWidget.js
@@ -47,7 +47,8 @@ AjaxSolr.AbstractSpellcheckWidget = AjaxSolr.AbstractWidget.extend(
this.suggestions = {};
if (this.manager.response.spellcheck && this.manager.response.spellcheck.suggestions) {
- var suggestions = this.manager.response.spellcheck.suggestions;
+ var suggestions = this.manager.response.spellcheck.suggestions,
+ empty = true;
for (var word in suggestions) {
if (word == 'collation' || word == 'correctlySpelled') continue;
@@ -61,9 +62,10 @@ AjaxSolr.AbstractSpellcheckWidget = AjaxSolr.AbstractWidget.extend(
this.suggestions[word].push(suggestions[word].suggestion[i]);
}
}
+ empty = false;
}
- if (AjaxSolr.size(this.suggestions)) {
+ if (!empty) {
this.handleSuggestions(this.manager.response);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.