Implement getEmptyMessage() in CorrectionsView

This commit is contained in:
Kevin Sawicki 2013-06-13 11:46:52 -07:00
parent 1bc4b4ef32
commit 75cfddebcd
2 changed files with 8 additions and 5 deletions

View File

@ -39,15 +39,18 @@ class CorrectionsView extends SelectList
attach: ->
@aboveCursor = false
if @corrections.length > 0
@setArray(@corrections)
else
@setError("No corrections found")
@setArray(@corrections)
@editor.appendToLinesView(this)
@setPosition()
@miniEditor.focus()
getEmptyMessage: (itemCount) ->
if itemCount is 0
'No corrections'
else
super
detach: ->
super

View File

@ -97,7 +97,7 @@ describe "Spell check", ->
editor.trigger 'editor:correct-misspelling'
expect(editor.find('.corrections').length).toBe 1
expect(editor.find('.corrections li').length).toBe 0
expect(editor.find('.corrections .error').text()).toBe "No corrections found"
expect(editor.find('.corrections').view().error.text()).toBe "No corrections"
describe "when the edit session is destroyed", ->
it "destroys all misspelling markers", ->