mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-06 11:35:24 +08:00
Add placeholder to textarea as well as text
This commit is contained in:
parent
1f8253898c
commit
95fc7167dd
@ -71,6 +71,11 @@ define(["widgets/js/widget"], function(WidgetManager){
|
||||
this.update(); // Set defaults.
|
||||
|
||||
this.model.on('msg:custom', $.proxy(this._handle_textarea_msg, this));
|
||||
this.model.on('change:placeholder', function(model, value, options) {
|
||||
this.update_placeholder(value);
|
||||
}, this);
|
||||
|
||||
this.update_placeholder();
|
||||
},
|
||||
|
||||
_handle_textarea_msg: function (content){
|
||||
@ -80,6 +85,13 @@ define(["widgets/js/widget"], function(WidgetManager){
|
||||
}
|
||||
},
|
||||
|
||||
update_placeholder: function(value) {
|
||||
if (!value) {
|
||||
value = this.model.get('placeholder');
|
||||
}
|
||||
this.$textbox.attr('placeholder', value);
|
||||
},
|
||||
|
||||
scroll_to_bottom: function (){
|
||||
// Scroll the text-area view to the bottom.
|
||||
this.$textbox.scrollTop(this.$textbox[0].scrollHeight);
|
||||
|
Loading…
Reference in New Issue
Block a user