Permalink
Browse files

remove dependency on AjaxSolr.size

  • Loading branch information...
jpmckinney committed Apr 13, 2013
1 parent aa5ad4b commit f5cacf206524851073a1890ca6bbcf1a5a98093a
Showing with 4 additions and 2 deletions.
  1. +4 −2 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);
}
}

0 comments on commit f5cacf2

Please sign in to comment.