diff options
author | William Lachance <wrlach@gmail.com> | 2017-07-11 22:27:35 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-07-11 22:27:35 +0200 |
commit | 096e19e6c6ed1b79059f098e1f7436404a97e6f9 (patch) | |
tree | 2cc55911c1e52ad0ca572860f5a619f077a67274 /extensions/BugModal/web/bug_modal.js | |
parent | bd10e74fa55e2062416fc193db76b73174398624 (diff) | |
download | bugzilla-096e19e6c6ed1b79059f098e1f7436404a97e6f9.tar.gz bugzilla-096e19e6c6ed1b79059f098e1f7436404a97e6f9.tar.xz |
Bug 1331305 - Auto-resize comment boxes
Inspired by earlier work by @KuoE0 in https://github.com/mozilla-bteam/bmo/pull/40
* address review comments
* Auto-resize comment when replying
Diffstat (limited to 'extensions/BugModal/web/bug_modal.js')
-rw-r--r-- | extensions/BugModal/web/bug_modal.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index 5a04709ec..6004c255b 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -868,16 +868,12 @@ $(function() { if ($('#comment').val() != reply_text) { $('#comment').val($('#comment').val() + reply_text); } + autosize.update($('#comment')); $.scrollTo($('#comment'), function() { $('#comment').focus(); }); }); - // add comment --> enlarge on focus - if (BUGZILLA.user.settings.zoom_textareas) { - $('#comment') - .focus(function(event) { - $(event.target).attr('rows', 25); - }); - } + // auto-enlarge comment area (up to its max-height) + autosize($('#comment')); // add comment --> private $('#add-comment-private-cb') |