|
|
|
|
@ -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);
|
|
|
|
|
|