Skip to content

Commit d501dc1

Browse files
committed
Fix empty popover.
1 parent 1f990c0 commit d501dc1

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

assets/js/spellchecker.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,25 @@ function check() {
200200
}
201201
$('.spellError').each(function () {
202202
var currentTokenId = this.id;
203-
$(this).popover({
204-
animation: false,
205-
placement: 'bottom',
206-
trigger: 'manual',
207-
html: true,
208-
content: content[currentTokenId]
209-
});
203+
if(content[currentTokenId].indexOf('spellCheckerListItem') !== -1) {
204+
$(this).popover({
205+
animation: false,
206+
placement: 'bottom',
207+
trigger: 'manual',
208+
html: true,
209+
content: content[currentTokenId]
210+
});
211+
}
212+
else {
213+
$(this).popover({
214+
animation: false,
215+
placement: 'bottom',
216+
trigger: 'manual',
217+
html: true,
218+
content: '<div style="padding: 4px 10px; color: #b94a48;">No spelling suggestions</div>'
219+
});
220+
}
210221
});
211-
212222
},
213223
error: handleSpellCheckerErrorResponse,
214224
complete: function () {

0 commit comments

Comments
 (0)