mirror of
https://github.com/atom/atom.git
synced 2026-02-11 07:05:11 -05:00
Support placeholderText parameter
This commit is contained in:
committed by
Antonio Scandurra
parent
36f5262f40
commit
4e00139965
@@ -315,7 +315,8 @@ class TextEditorComponent {
|
||||
style.height = height
|
||||
children = [
|
||||
this.renderCursorsAndInput(width, height),
|
||||
this.renderLineTiles(width, height)
|
||||
this.renderLineTiles(width, height),
|
||||
this.renderPlaceholderText()
|
||||
]
|
||||
} else {
|
||||
children = $.div({ref: 'characterMeasurementLine', className: 'line'},
|
||||
@@ -427,6 +428,17 @@ class TextEditorComponent {
|
||||
}, children)
|
||||
}
|
||||
|
||||
renderPlaceholderText () {
|
||||
const {model} = this.props
|
||||
if (model.isEmpty()) {
|
||||
const placeholderText = model.getPlaceholderText()
|
||||
if (placeholderText != null) {
|
||||
return $.div({className: 'placeholder-text'}, placeholderText)
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
renderHiddenInput () {
|
||||
let top, left
|
||||
if (this.hiddenInputPosition) {
|
||||
|
||||
Reference in New Issue
Block a user