Move movement logic to cursor subview.

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-01-23 12:50:07 -08:00
parent 98947877e5
commit 3d45a5201d
3 changed files with 49 additions and 55 deletions

View File

@@ -96,8 +96,8 @@ fdescribe "Editor", ->
editor.attachToDom()
editor.setPosition(row: 2, col: 2)
expect(editor.cursor.position().top).toBe(2 * editor.lineHeight())
expect(editor.cursor.position().left).toBe(2 * editor.charWidth())
expect(editor.cursor.position().top).toBe(2 * editor.lineHeight)
expect(editor.cursor.position().left).toBe(2 * editor.charWidth)
describe "when the editor is attached to the dom", ->
@@ -106,6 +106,6 @@ fdescribe "Editor", ->
editor.attachToDom()
expect(editor.cursor.position().top).toBe(2 * editor.lineHeight())
expect(editor.cursor.position().left).toBe(2 * editor.charWidth())
expect(editor.cursor.position().top).toBe(2 * editor.lineHeight)
expect(editor.cursor.position().left).toBe(2 * editor.charWidth)