fix stream panel
This commit is contained in:
@@ -44,16 +44,19 @@ Espo.define('views/note/fields/post', ['views/fields/text', 'lib!Textcomplete'],
|
||||
Dep.prototype.setup.call(this);
|
||||
},
|
||||
|
||||
controlTextareaHeight: function () {
|
||||
controlTextareaHeight: function (lastHeight) {
|
||||
var scrollHeight = this.$element.prop('scrollHeight');
|
||||
var clientHeight = this.$element.prop('clientHeight');
|
||||
if (this.$element.prop('scrollHeight') > clientHeight + 2) {
|
||||
this.$element.prop('rows', this.$element.prop('rows') + 1);
|
||||
this.controlTextareaHeight();
|
||||
|
||||
if (clientHeight === lastHeight) return;
|
||||
|
||||
if (scrollHeight > clientHeight) {
|
||||
this.$element.attr('rows', this.$element.prop('rows') + 1);
|
||||
this.controlTextareaHeight(clientHeight);
|
||||
}
|
||||
|
||||
if (this.$element.val().length === 0) {
|
||||
this.$element.prop('rows', 1);
|
||||
this.$element.attr('rows', 1);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -78,15 +78,18 @@ Espo.define('views/stream/panel', ['views/record/panels/relationship', 'lib!Text
|
||||
return data;
|
||||
},
|
||||
|
||||
controlTextareaHeight: function () {
|
||||
controlTextareaHeight: function (lastHeight) {
|
||||
var scrollHeight = this.$textarea.prop('scrollHeight');
|
||||
var clientHeight = this.$textarea.prop('clientHeight');
|
||||
if (this.$textarea.prop('scrollHeight') > clientHeight + 2) {
|
||||
this.$textarea.prop('rows', this.$textarea.prop('rows') + 1);
|
||||
this.controlTextareaHeight();
|
||||
|
||||
if (clientHeight === lastHeight) return;
|
||||
|
||||
if (scrollHeight > clientHeight) {
|
||||
this.$textarea.attr('rows', this.$textarea.prop('rows') + 1);
|
||||
this.controlTextareaHeight(clientHeight);
|
||||
}
|
||||
if (this.$textarea.val().length === 0) {
|
||||
this.$textarea.prop('rows', 1);
|
||||
this.$textarea.attr('rows', 1);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user