From: W. Trevor King Date: Sun, 21 Sep 2014 13:06:18 +0000 (-0700) Subject: nmbug.js: Add tag-toggling with a stub _toggle_tag X-Git-Tag: v0.1.0~23 X-Git-Url: http://git.tremily.us/?p=nmhive.git;a=commitdiff_plain;h=f124dd04a9ad3b96b2bc23a46d4ff672b967018a nmbug.js: Add tag-toggling with a stub _toggle_tag This takes care of binding the new method and adjusting the CSS. --- diff --git a/nmbug.js b/nmbug.js index 3493377..669272d 100644 --- a/nmbug.js +++ b/nmbug.js @@ -95,9 +95,12 @@ nmbug = { for (var i = 0; i < available_tags.length; i++) { var li = document.createElement('li'); li.innerHTML = available_tags[i]; + li.style.cursor = 'pointer'; if (tags.indexOf(available_tags[i]) >= 0) { li.style.backgroundColor = 'lime'; } + li.onclick = this._toggle_tag.bind( + this, message_id, available_tags[i], li); ul.appendChild(li); } var close = document.createElement('button'); @@ -111,6 +114,9 @@ nmbug = { dialog.show(); }, + _toggle_tag: function (message_id, tag, li) { + alert('toggle ' + tag + ' for ' + message_id); + }, }; var _gmane_handler = {