summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMary Umoh <umohm12@gmail.com>2017-07-18 00:06:23 +0200
committerDylan William Hardison <dylan@hardison.net>2017-07-18 00:06:23 +0200
commite203bc3af47406339870e718475f0f0ea194f6c9 (patch)
treefc8739c2dd1fe5dcce8325cfe9817b435d504003 /extensions
parente08b1e57d8f4921821ba68ceea96c9eaaa1729f8 (diff)
downloadbugzilla-e203bc3af47406339870e718475f0f0ea194f6c9.tar.gz
bugzilla-e203bc3af47406339870e718475f0f0ea194f6c9.tar.xz
Bug 1380389 - autosize comments should be a user pref (default: on)
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BugModal/template/en/default/bug_modal/header.html.tmpl3
-rw-r--r--extensions/BugModal/web/bug_modal.js23
2 files changed, 18 insertions, 8 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
index db9bbeb7a..a91d11576 100644
--- a/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
+++ b/extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
@@ -107,7 +107,8 @@
settings: {
quote_replies: '[% user.settings.quote_replies.value FILTER js %]',
zoom_textareas: [% user.settings.zoom_textareas.value == "on" ? "true" : "false" %],
- remember_collapsed: [% user.settings.ui_remember_collapsed.value == "on" ? "true" : "false" %]
+ remember_collapsed: [% user.settings.ui_remember_collapsed.value == "on" ? "true" : "false" %],
+ autosize_comments: [% user.settings.autosize_comments.value == "on" ? "true" : "false" %]
}
};
[% IF user.id %]
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js
index 6004c255b..5ca0148e7 100644
--- a/extensions/BugModal/web/bug_modal.js
+++ b/extensions/BugModal/web/bug_modal.js
@@ -458,7 +458,7 @@ $(function() {
var rbs = $("#readable-bug-status");
var rbs_text = bugzillaReadableStatus.readable(rbs.data('readable-bug-status'));
rbs.text(rbs_text);
-
+
if (BUGZILLA.user.id === 0) return;
//
@@ -853,8 +853,7 @@ $(function() {
if (BUGZILLA.user.settings.quote_replies == 'quoted_reply') {
var text = $('#ct-' + comment_id).text();
reply_text = prefix + wrapReplyText(text);
- }
- else if (BUGZILLA.user.settings.quote_replies == 'simply_reply') {
+ } else if (BUGZILLA.user.settings.quote_replies == 'simply_reply') {
reply_text = prefix;
}
@@ -868,12 +867,22 @@ $(function() {
if ($('#comment').val() != reply_text) {
$('#comment').val($('#comment').val() + reply_text);
}
- autosize.update($('#comment'));
- $.scrollTo($('#comment'), function() { $('#comment').focus(); });
+ if (BUGZILLA.user.settings.autosize_comments) {
+ autosize.update($('#comment'));
+ }
+ $.scrollTo($('#comment'), function() {
+ $('#comment').focus();
+ });
});
- // auto-enlarge comment area (up to its max-height)
- autosize($('#comment'));
+ if (BUGZILLA.user.settings.autosize_comments) {
+ autosize($('#comment'));
+ } else if (BUGZILLA.user.settings.zoom_textareas) {
+ // add comment --> enlarge on focus
+ $('#comment').focus(function(event) {
+ $(event.target).attr('rows', 25);
+ });
+ }
// add comment --> private
$('#add-comment-private-cb')