Update spell check view to use new task

This commit is contained in:
Kevin Sawicki
2013-06-13 17:12:23 -07:00
committed by probablycorey
parent a1d6ae010e
commit b42cc6f683
4 changed files with 10 additions and 9 deletions

View File

@@ -1,12 +1,12 @@
Task = require 'task'
fdescribe "Task", ->
describe "Task", ->
describe "populating the window with fake properties", ->
describe "when jQuery is loaded in a child process", ->
it "doesn't log to the console", ->
spyOn(console, 'log').andCallThrough()
spyOn(console, 'error').andCallThrough()
spyOn(console, 'warn').andCallThrough()
spyOn(console, 'log')
spyOn(console, 'error')
spyOn(console, 'warn')
jqueryTask = new Task('fixtures/jquery-task-handler.coffee')
jqueryLoaded = false

View File

@@ -1,6 +1,6 @@
{View} = require 'space-pen'
_ = require 'underscore'
SpellCheckTask = require './spell-check-task'
Task = require 'task'
MisspellingView = require './misspelling-view'
module.exports =
@@ -8,6 +8,7 @@ class SpellCheckView extends View
@content: ->
@div class: 'spell-check'
task: null
views: []
initialize: (@editor) ->
@@ -21,10 +22,10 @@ class SpellCheckView extends View
beforeRemove: ->
@unsubscribeFromBuffer()
@task?.terminate
unsubscribeFromBuffer: ->
@destroyViews()
@task?.abort()
if @buffer?
@buffer.off 'contents-modified', @updateMisspellings
@@ -54,6 +55,6 @@ class SpellCheckView extends View
@append(view)
updateMisspellings: =>
@task.start buffer.getText(), (misspellings) =>
@task.start @buffer.getText(), (misspellings) =>
@destroyViews()
@addViews(misspellings)

View File

@@ -1,6 +1,6 @@
RootView = require 'root-view'
fdescribe "Spell check", ->
describe "Spell check", ->
[editor] = []
beforeEach ->

View File

@@ -43,4 +43,4 @@ class Task
@off()
_.extend Task.prototype, EventEmitter
_.extend Task.prototype, EventEmitter