mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 12:33:07 +00:00
Merge pull request #508 from thelounge/PR/optimize-textarea
Slight optimization in the textarea code
This commit is contained in:
commit
9d547315f7
1 changed files with 5 additions and 1 deletions
|
@ -632,6 +632,8 @@ $(function() {
|
|||
.history()
|
||||
.on("input keyup", function() {
|
||||
var style = window.getComputedStyle(this);
|
||||
var origHeight = this.style.height;
|
||||
|
||||
this.style.height = "0px";
|
||||
this.offsetHeight; // force reflow
|
||||
this.style.height = Math.min(
|
||||
|
@ -641,7 +643,9 @@ $(function() {
|
|||
+ Math.round(parseFloat(style.borderBottomWidth) || 0)
|
||||
) + "px";
|
||||
|
||||
$("#chat .chan.active .chat").trigger("msg.sticky"); // fix growing
|
||||
if (this.style.height !== origHeight) {
|
||||
$("#chat .chan.active .chat").trigger("msg.sticky"); // fix growing
|
||||
}
|
||||
})
|
||||
.tab(complete, {hint: false});
|
||||
|
||||
|
|
Loading…
Reference in a new issue