Merge pull request #555 from thelounge/astorije/fix-reset-height
Make sure input height is reset when submitting with icon
This commit is contained in:
commit
4ddaa9a69a
@ -631,6 +631,10 @@ $(function() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function resetInputHeight(input) {
|
||||||
|
input.style.height = input.style.minHeight;
|
||||||
|
}
|
||||||
|
|
||||||
var input = $("#input")
|
var input = $("#input")
|
||||||
.history()
|
.history()
|
||||||
.on("input keyup", function() {
|
.on("input keyup", function() {
|
||||||
@ -638,7 +642,7 @@ $(function() {
|
|||||||
|
|
||||||
// Start by resetting height before computing as scrollHeight does not
|
// Start by resetting height before computing as scrollHeight does not
|
||||||
// decrease when deleting characters
|
// decrease when deleting characters
|
||||||
this.style.height = this.style.minHeight;
|
resetInputHeight(this);
|
||||||
|
|
||||||
this.style.height = Math.min(
|
this.style.height = Math.min(
|
||||||
Math.round(window.innerHeight - 100), // prevent overflow
|
Math.round(window.innerHeight - 100), // prevent overflow
|
||||||
@ -662,6 +666,7 @@ $(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input.val("");
|
input.val("");
|
||||||
|
resetInputHeight(input.get(0));
|
||||||
|
|
||||||
if (text.indexOf("/clear") === 0) {
|
if (text.indexOf("/clear") === 0) {
|
||||||
clear();
|
clear();
|
||||||
|
Loading…
Reference in New Issue
Block a user