fix stream panel

This commit is contained in:
yuri
2016-12-23 16:55:22 +02:00
parent 5951ac930a
commit 3df9c7eb02
2 changed files with 16 additions and 10 deletions
+8 -5
View File
@@ -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);
}
},
+8 -5
View File
@@ -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);
}
},