fix(signatures): Monospace font, nested scrolling fix

This commit is contained in:
Ben Gotow 2015-11-30 14:26:11 -08:00
parent 6150d51eda
commit c2055907f3
3 changed files with 10 additions and 5 deletions

View file

@ -23,11 +23,9 @@ class PreferencesSignatures extends React.Component
selectedAccountId: selectedAccountId
componentDidMount: ->
console.log "Mounting preferences"
@usub = AccountStore.listen @_onChange
componentWillUnmount: ->
console.log "Unmounting preferences"
@usub()
@_saveSignatureNow(@state.selectedAccountId, @state.currentSignature)
@ -104,7 +102,8 @@ class PreferencesSignatures extends React.Component
render: =>
rawText = if @state.editAsHTML then "Raw HTML " else ""
<div className="container-signatures">
<section className="container-signatures">
<h2>Signatures</h2>
<div className="section-title">
{rawText}Signature for: {@_renderAccountPicker()}
</div>
@ -112,6 +111,6 @@ class PreferencesSignatures extends React.Component
{if @state.editAsHTML then @_renderHTMLSignature() else @_renderEditableSignature()}
</div>
<div className="toggle-mode" style={marginTop: "1em"}>{@_renderModeToggle()}</div>
</div>
</section>
module.exports = PreferencesSignatures

View file

@ -15,6 +15,8 @@
border: 0;
padding: 0;
flex: 1;
font-family: monospace;
font-size: 0.9em;
}
}
@ -68,4 +70,3 @@
}
}
}

View file

@ -312,6 +312,11 @@ class ScrollRegion extends React.Component
@setState(state)
_onScroll: (event) =>
# onScroll events propogate, which is a bit strange. We could actually be
# receiving a scroll event for a textarea inside the scroll region.
# See Preferences > Signatures > textarea
return unless event.target is React.findDOMNode(@refs.content)
if not @state.scrolling
@recomputeDimensions()
@_setSharedState(scrolling: true)