Commit 495b9da4 authored by Albert Ting's avatar Albert Ting Committed by David Lawrence

Bug 1116666: Auto add comment class based on the tag

r=dkl,a=glob
parent ac3f8d97
...@@ -233,8 +233,10 @@ YAHOO.bugzilla.commentTagging = { ...@@ -233,8 +233,10 @@ YAHOO.bugzilla.commentTagging = {
buildTagHtml : function(comment_id, comment_no, tag) { buildTagHtml : function(comment_id, comment_no, tag) {
var el = document.createElement('span'); var el = document.createElement('span');
var c_el =Dom.get('c' + comment_no);
Dom.setAttribute(el, 'id', 'ct_' + comment_no + '_' + tag); Dom.setAttribute(el, 'id', 'ct_' + comment_no + '_' + tag);
Dom.addClass(el, 'bz_comment_tag'); Dom.addClass(el, 'bz_comment_tag');
Dom.addClass(c_el, 'bz_comment_tag_' + tag);
if (this.can_edit) { if (this.can_edit) {
var a = document.createElement('a'); var a = document.createElement('a');
Dom.setAttribute(a, 'href', '#'); Dom.setAttribute(a, 'href', '#');
...@@ -282,6 +284,8 @@ YAHOO.bugzilla.commentTagging = { ...@@ -282,6 +284,8 @@ YAHOO.bugzilla.commentTagging = {
remove : function(comment_id, comment_no, tag) { remove : function(comment_id, comment_no, tag) {
var el = Dom.get('ct_' + comment_no + '_' + tag); var el = Dom.get('ct_' + comment_no + '_' + tag);
var c_el =Dom.get('c' + comment_no);
Dom.removeClass(c_el, 'bz_comment_tag_' + tag);
if (el) { if (el) {
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
this.rpcUpdate(comment_id, comment_no, undefined, [ tag ]); this.rpcUpdate(comment_id, comment_no, undefined, [ tag ]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment