diff options
author | David Lawrence <dkl@mozilla.com> | 2014-11-04 21:46:41 +0000 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2014-11-04 21:46:41 +0000 |
commit | f5fc4a6d6bf930607d8dd5cd7ffeb78a1044918f (patch) | |
tree | b95c7e398739df2b8447d93a32a1b10f2c9fc2e7 /js | |
parent | fc62fd4082c76068c2062f4e50b88c0908db2be2 (diff) | |
download | bugs-f5fc4a6d6bf930607d8dd5cd7ffeb78a1044918f.tar bugs-f5fc4a6d6bf930607d8dd5cd7ffeb78a1044918f.tar.gz bugs-f5fc4a6d6bf930607d8dd5cd7ffeb78a1044918f.tar.bz2 bugs-f5fc4a6d6bf930607d8dd5cd7ffeb78a1044918f.tar.xz bugs-f5fc4a6d6bf930607d8dd5cd7ffeb78a1044918f.zip |
Revert Bug 330707 - Add optional support for MarkDown
Diffstat (limited to 'js')
-rw-r--r-- | js/field.js | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/js/field.js b/js/field.js index c24603988..5589bc498 100644 --- a/js/field.js +++ b/js/field.js @@ -983,33 +983,17 @@ function initDirtyFieldTracking() { */ var last_comment_text = ''; -var last_markdown_cb_value = null; -var comment_textarea_width = null; -var comment_textarea_height = null; -function refresh_markdown_preview (bug_id) { - if (!YAHOO.util.Dom.hasClass('comment_preview_tab', 'active_comment_tab')) - return; - show_comment_preview(bug_id, 1); -} - -function show_comment_preview(bug_id, refresh) { +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') && !refresh) - return; + if (Dom.hasClass('comment_preview_tab', 'active_comment_tab')) return; - if (!comment_textarea_width) { - comment_textarea_width = (comment.clientWidth - 4) + 'px'; - comment_textarea_height = comment.offsetHeight + 'px'; - } - - preview.style.width = comment_textarea_width; - preview.style.height = comment_textarea_height; + preview.style.width = (comment.clientWidth - 4) + 'px'; + preview.style.height = comment.offsetHeight + 'px'; var comment_tab = document.getElementById('comment_tab'); Dom.addClass(comment, 'bz_default_hidden'); @@ -1023,7 +1007,7 @@ function show_comment_preview(bug_id, refresh) { Dom.addClass('comment_preview_error', 'bz_default_hidden'); - if (last_comment_text == comment.value && last_markdown_cb_value == markdown_cb.checked) + if (last_comment_text == comment.value) return; Dom.addClass('comment_preview_text', 'bz_default_hidden'); @@ -1043,14 +1027,7 @@ function show_comment_preview(bug_id, refresh) { document.getElementById('comment_preview_text').innerHTML = data.result.html; Dom.addClass('comment_preview_loading', 'bz_default_hidden'); Dom.removeClass('comment_preview_text', 'bz_default_hidden'); - if (markdown_cb.checked) { - Dom.removeClass('comment_preview_text', 'comment_preview_pre'); - } - else { - Dom.addClass('comment_preview_text', 'comment_preview_pre'); - } last_comment_text = comment.value; - last_markdown_cb_value = markdown_cb.checked; } }, failure: function(res) { @@ -1066,8 +1043,7 @@ function show_comment_preview(bug_id, refresh) { params: { Bugzilla_api_token: BUGZILLA.api_token, id: bug_id, - text: comment.value, - markdown: (markdown_cb != null) && markdown_cb.checked ? 1 : 0 + text: comment.value } }) ); |