Update editor lines & cursors to not use bootstrap-styled pre element

This commit is contained in:
Nathan Sobo
2013-04-12 14:47:57 -06:00
parent 738fc31f56
commit 91cbcf0073
3 changed files with 8 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ _ = require 'underscore'
module.exports =
class CursorView extends View
@content: ->
@pre class: 'cursor idle', => @raw ' '
@div class: 'cursor idle', => @raw ' '
blinkPeriod: 800
editor: null

View File

@@ -726,7 +726,7 @@ class Editor extends View
@overlayer.append(view)
calculateDimensions: ->
fragment = $('<pre class="line" style="position: absolute; visibility: hidden;"><span>x</span></div>')
fragment = $('<div class="line" style="position: absolute; visibility: hidden;"><span>x</span></div>')
@renderedLines.append(fragment)
lineRect = fragment[0].getBoundingClientRect()
@@ -1052,7 +1052,7 @@ class Editor extends View
attributePairs = []
attributePairs.push "#{attributeName}=\"#{value}\"" for attributeName, value of lineAttributes
line.push("<pre #{attributePairs.join(' ')}>")
line.push("<div #{attributePairs.join(' ')}>")
invisibles = @invisibles if @showInvisibles
@@ -1081,7 +1081,7 @@ class Editor extends View
line.push("<span class='fold-marker'/>") if fold
line.push('</pre>')
line.push('</div>')
line.join('')
lineElementForScreenRow: (screenRow) ->

View File

@@ -139,6 +139,10 @@
position: absolute;
}
.editor .line {
white-space: pre;
}
.editor .line span {
vertical-align: top;
}