From 49d6fa99da2e52f3db89fd84802049f1dfa7c58c Mon Sep 17 00:00:00 2001 From: im-mi Date: Fri, 2 Sep 2016 05:08:58 -0400 Subject: [PATCH 1/2] Clear the mass tagger's selection on load .. in case it was autocompleted by the browser. --- ext/mass_tagger/script.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/mass_tagger/script.js b/ext/mass_tagger/script.js index 7a028e01..26b3e61c 100644 --- a/ext/mass_tagger/script.js +++ b/ext/mass_tagger/script.js @@ -34,3 +34,8 @@ function toggle_tag( button, id ) { list.val(string); } } + +$(function () { + // Clear the selection, in case it was autocompleted by the browser. + $('#mass_tagger_ids').val(""); +}); From d2540a9619670e10eca8d9cec6bf2abefc955837 Mon Sep 17 00:00:00 2001 From: im-mi Date: Fri, 2 Sep 2016 05:14:55 -0400 Subject: [PATCH 2/2] Use CSS for mass tagger button styling --- ext/mass_tagger/script.js | 4 ++-- ext/mass_tagger/style.css | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 ext/mass_tagger/style.css diff --git a/ext/mass_tagger/script.js b/ext/mass_tagger/script.js index 26b3e61c..0e4dbcd9 100644 --- a/ext/mass_tagger/script.js +++ b/ext/mass_tagger/script.js @@ -24,12 +24,12 @@ function toggle_tag( button, id ) { var string = list.val(); if( (string.indexOf(id) == 0) || (string.indexOf(":"+id) > -1) ) { - $(button).css('border', 'none'); + $(button).removeClass('mass-tagger-selected'); string = string.replace(id, ''); list.val(string); } else { - $(button).css('border', '3px solid blue'); + $(button).addClass('mass-tagger-selected'); string += id; list.val(string); } diff --git a/ext/mass_tagger/style.css b/ext/mass_tagger/style.css new file mode 100644 index 00000000..c0a2ea6c --- /dev/null +++ b/ext/mass_tagger/style.css @@ -0,0 +1,3 @@ +.mass-tagger-selected { + border: 3px solid blue; +} \ No newline at end of file