Remove resize listeners from editor

pollDOM will always be called when window is resized
This commit is contained in:
Jessica Lord
2015-07-21 11:19:54 -07:00
committed by Nathan Sobo
parent 96874d68d8
commit 40ba0da4f5

View File

@@ -107,7 +107,6 @@ class TextEditorComponent
@disposables.dispose()
@presenter.destroy()
@gutterContainerComponent?.destroy()
window.removeEventListener 'resize', @requestHeightAndWidthMeasurement
getDomNode: ->
@domNode
@@ -224,7 +223,6 @@ class TextEditorComponent
@domNode.addEventListener 'textInput', @onTextInput
@scrollViewNode.addEventListener 'mousedown', @onMouseDown
@scrollViewNode.addEventListener 'scroll', @onScrollViewScroll
window.addEventListener 'resize', @requestHeightAndWidthMeasurement
@listenForIMEEvents()
@trackSelectionClipboard() if process.platform is 'linux'
@@ -589,15 +587,6 @@ class TextEditorComponent
else
@wasVisible = false
requestHeightAndWidthMeasurement: =>
return if @heightAndWidthMeasurementRequested
@heightAndWidthMeasurementRequested = true
requestAnimationFrame =>
@heightAndWidthMeasurementRequested = false
@measureDimensions()
@measureWindowSize()
# Measure explicitly-styled height and width and relay them to the model. If
# these values aren't explicitly styled, we assume the editor is unconstrained
# and use the scrollHeight / scrollWidth as its height and width in