From 7de2ad34aa7e5e2ea47ccb7face4e81f46111229 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Tue, 12 Aug 2014 14:52:59 -0700 Subject: [PATCH] Remove opaque backgrounds on mini editors Fixes #3239 --- spec/editor-component-spec.coffee | 3 +++ src/editor-component.coffee | 2 +- src/lines-component.coffee | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index 812ebb9a0..603892b19 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -2103,6 +2103,9 @@ describe "EditorComponent", -> it "adds the 'mini' class to the wrapper view", -> expect(wrapperNode.classList.contains('mini')).toBe true + it "does not have an opaque background on lines", -> + expect(component.refs.lines.getDOMNode().getAttribute('style')).not.toContain 'background-color' + it "does not render invisible characters", -> component.setInvisibles(eol: 'E') component.setShowInvisibles(true) diff --git a/src/editor-component.coffee b/src/editor-component.coffee index 5c1b46a5a..3e1418539 100644 --- a/src/editor-component.coffee +++ b/src/editor-component.coffee @@ -112,7 +112,7 @@ EditorComponent = React.createClass @scrollingVertically, scrollHeight, scrollWidth, mouseWheelScreenRow, invisibles, @visible, scrollViewHeight, @scopedCharacterWidthsChangeCount, lineWidth, @useHardwareAcceleration, placeholderText, @performedInitialMeasurement, @backgroundColor, cursorPixelRects, - cursorBlinkPeriod, cursorBlinkResumeDelay + cursorBlinkPeriod, cursorBlinkResumeDelay, mini } ScrollbarComponent diff --git a/src/lines-component.coffee b/src/lines-component.coffee index 906771bbc..ad39fa613 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -22,12 +22,12 @@ LinesComponent = React.createClass if performedInitialMeasurement {editor, highlightDecorations, scrollHeight, scrollWidth, placeholderText, backgroundColor} = @props {lineHeightInPixels, defaultCharWidth, scrollViewHeight, scopedCharacterWidthsChangeCount} = @props - {scrollTop, scrollLeft, cursorPixelRects} = @props + {scrollTop, scrollLeft, cursorPixelRects, mini} = @props style = height: Math.max(scrollHeight, scrollViewHeight) width: scrollWidth WebkitTransform: @getTransform() - backgroundColor: backgroundColor + backgroundColor: if mini then null else backgroundColor div {className: 'lines', style}, div className: 'placeholder-text', placeholderText if placeholderText?