##// END OF EJS Templates
Add placeholder to textarea as well as text
Jessica B. Hamrick -
Show More
@@ -71,6 +71,11 define(["widgets/js/widget"], function(WidgetManager){
71 this.update(); // Set defaults.
71 this.update(); // Set defaults.
72
72
73 this.model.on('msg:custom', $.proxy(this._handle_textarea_msg, this));
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 _handle_textarea_msg: function (content){
81 _handle_textarea_msg: function (content){
@@ -80,6 +85,13 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 scroll_to_bottom: function (){
95 scroll_to_bottom: function (){
84 // Scroll the text-area view to the bottom.
96 // Scroll the text-area view to the bottom.
85 this.$textbox.scrollTop(this.$textbox[0].scrollHeight);
97 this.$textbox.scrollTop(this.$textbox[0].scrollHeight);
General Comments 0
You need to be logged in to leave comments. Login now