Merge lp:~huwshimi/launchpad/tag-field-space-394342 into lp:launchpad

Proposed by Huw Wilkins
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 12424
Proposed branch: lp:~huwshimi/launchpad/tag-field-space-394342
Merge into: lp:launchpad
Diff against target: 20 lines (+8/-2)
1 file modified
lib/lp/bugs/javascript/bug_tags_entry.js (+8/-2)
To merge this branch: bzr merge lp:~huwshimi/launchpad/tag-field-space-394342
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
William Grant code* Approve
Martin Pool (community) Approve
Review via email: mp+49342@code.launchpad.net

Commit message

[r=lifeless,mbp,wgrant][ui=none] [r=lifeless,mbp,wgrant][bug=394342] Removed initial space character from bug tag field when editing and there are no tags.

Description of the change

Removed initial space character from bug tag field when editing and there are no tags.

TO TEST:
View a bug that has no tags. Click "Add tags". The field should be completely empty (used to contain a single space character).

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

s/sting/string

is there a style guide saying there must be trailing semicolons

review: Needs Fixing
Revision history for this message
Martin Pool (mbp) :
review: Approve
Revision history for this message
William Grant (wgrant) :
review: Approve (code*)
Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/javascript/bug_tags_entry.js'
2--- lib/lp/bugs/javascript/bug_tags_entry.js 2011-02-08 03:15:37 +0000
3+++ lib/lp/bugs/javascript/bug_tags_entry.js 2011-02-21 04:37:07 +0000
4@@ -46,8 +46,14 @@
5 tag_list_span.all(A).each(function(anchor) {
6 tags.push(anchor.get(INNER_HTML));
7 });
8-
9- tag_input.set(VALUE, tags.join(' ') + ' ');
10+
11+ var tag_list = tags.join(' ');
12+ /* If there are tags then add a space to the end of the string so the user
13+ doesn't have to type one. */
14+ if (tag_list != "") {
15+ tag_list += ' ';
16+ }
17+ tag_input.set(VALUE, tag_list);
18 };
19
20 /**