##// END OF EJS Templates
Add placeholder to textarea as well as text
Jessica B. Hamrick -
Show More
@@ -71,6 +71,11 b' define(["widgets/js/widget"], function(WidgetManager){'
71 71 this.update(); // Set defaults.
72 72
73 73 this.model.on('msg:custom', $.proxy(this._handle_textarea_msg, this));
74 this.model.on('change:placeholder', function(model, value, options) {
75 this.update_placeholder(value);
76 }, this);
77
78 this.update_placeholder();
74 79 },
75 80
76 81 _handle_textarea_msg: function (content){
@@ -80,6 +85,13 b' define(["widgets/js/widget"], function(WidgetManager){'
80 85 }
81 86 },
82 87
88 update_placeholder: function(value) {
89 if (!value) {
90 value = this.model.get('placeholder');
91 }
92 this.$textbox.attr('placeholder', value);
93 },
94
83 95 scroll_to_bottom: function (){
84 96 // Scroll the text-area view to the bottom.
85 97 this.$textbox.scrollTop(this.$textbox[0].scrollHeight);
General Comments 0
You need to be logged in to leave comments. Login now