From f124dd04a9ad3b96b2bc23a46d4ff672b967018a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 21 Sep 2014 06:06:18 -0700 Subject: [PATCH] nmbug.js: Add tag-toggling with a stub _toggle_tag This takes care of binding the new method and adjusting the CSS. --- nmbug.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 = { -- 2.26.2