summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorKoosha KM <koosha.khajeh@gmail.com>2014-08-28 19:17:54 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-08-28 19:17:54 +0200
commitec5caa57cc14a328b8b994d49cb8def8eb95aea7 (patch)
tree08eec320a2361b41fcd400259770d6357a913e15 /js
parent82346032ecfef148e78a8d19e17c5ed41ed41d10 (diff)
downloadbugzilla-ec5caa57cc14a328b8b994d49cb8def8eb95aea7.tar.gz
bugzilla-ec5caa57cc14a328b8b994d49cb8def8eb95aea7.tar.xz
Bug 330707: Add optional support for MarkDown
r=dkl,a=sgreen
Diffstat (limited to 'js')
-rw-r--r--js/field.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/field.js b/js/field.js
index 7c5c5b64e..20b08da48 100644
--- a/js/field.js
+++ b/js/field.js
@@ -979,11 +979,13 @@ function initDirtyFieldTracking() {
*/
var last_comment_text = '';
+var last_markdown_cb_value = null;
function show_comment_preview(bug_id) {
var Dom = YAHOO.util.Dom;
var comment = document.getElementById('comment');
var preview = document.getElementById('comment_preview');
+ var markdown_cb = document.getElementById('use_markdown');
if (!comment || !preview) return;
if (Dom.hasClass('comment_preview_tab', 'active_comment_tab')) return;
@@ -1003,7 +1005,7 @@ function show_comment_preview(bug_id) {
Dom.addClass('comment_preview_error', 'bz_default_hidden');
- if (last_comment_text == comment.value)
+ if (last_comment_text == comment.value && last_markdown_cb_value == markdown_cb.checked)
return;
Dom.addClass('comment_preview_text', 'bz_default_hidden');
@@ -1024,6 +1026,7 @@ function show_comment_preview(bug_id) {
Dom.addClass('comment_preview_loading', 'bz_default_hidden');
Dom.removeClass('comment_preview_text', 'bz_default_hidden');
last_comment_text = comment.value;
+ last_markdown_cb_value = markdown_cb.checked;
}
},
failure: function(res) {
@@ -1039,7 +1042,8 @@ function show_comment_preview(bug_id) {
params: {
Bugzilla_api_token: BUGZILLA.api_token,
id: bug_id,
- text: comment.value
+ text: comment.value,
+ markdown: (markdown_cb != null) && markdown_cb.checked ? 1 : 0
}
})
);