Skip to content

Commit

Permalink
Fix empty popover.
Browse files Browse the repository at this point in the history
  • Loading branch information
JPJPJPOPOP committed Jan 9, 2018
1 parent 1f990c0 commit d501dc1
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions assets/js/spellchecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,25 @@ function check() {
}
$('.spellError').each(function () {
var currentTokenId = this.id;
$(this).popover({
animation: false,
placement: 'bottom',
trigger: 'manual',
html: true,
content: content[currentTokenId]
});
if(content[currentTokenId].indexOf('spellCheckerListItem') !== -1) {
$(this).popover({
animation: false,
placement: 'bottom',
trigger: 'manual',
html: true,
content: content[currentTokenId]
});
}
else {
$(this).popover({
animation: false,
placement: 'bottom',
trigger: 'manual',
html: true,
content: '<div style="padding: 4px 10px; color: #b94a48;">No spelling suggestions</div>'
});
}
});

},
error: handleSpellCheckerErrorResponse,
complete: function () {
Expand Down

0 comments on commit d501dc1

Please sign in to comment.