Merge lp:~cjwatson/launchpad/choose-icon into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18437
Proposed branch: lp:~cjwatson/launchpad/choose-icon
Merge into: lp:launchpad
Diff against target: 41 lines (+11/-8)
2 files modified
lib/lp/app/javascript/calendar.js (+5/-1)
lib/lp/app/javascript/picker/picker_patcher.js (+6/-7)
To merge this branch: bzr merge lp:~cjwatson/launchpad/choose-icon
Reviewer Review Type Date Requested Status
William Grant Approve
Review via email: mp+327983@code.launchpad.net

Commit message

Show a search icon for pickers where possible rather than "Choose...".

Description of the change

I always thought the green "Choose..." text looked rather ugly, and it gets particularly bad in a branch I'm working on where I have Git repository and branch input boxes displayed in a single row. Requesting a picker is essentially a search operation, or at least the start of one, so I think it makes sense to use the search icon here.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/javascript/calendar.js'
2--- lib/lp/app/javascript/calendar.js 2017-07-21 17:35:14 +0000
3+++ lib/lp/app/javascript/calendar.js 2017-07-24 17:48:33 +0000
4@@ -178,7 +178,11 @@
5 }
6 var parent_node = date_input.ancestor();
7 var choose_link = Y.Node.create(
8- '<span>(<a class="js-action" href="#">Choose...</a>)</span>');
9+ '<span>' +
10+ '<a href="#" class="sprite search-icon action-icon js-action">' +
11+ 'Choose\u2026' +
12+ '</a>' +
13+ '</span>');
14 parent_node.insertBefore(choose_link, date_input.next());
15
16 // Add a class to flag that this date-input is setup.
17
18=== modified file 'lib/lp/app/javascript/picker/picker_patcher.js'
19--- lib/lp/app/javascript/picker/picker_patcher.js 2017-07-20 13:29:41 +0000
20+++ lib/lp/app/javascript/picker/picker_patcher.js 2017-07-24 17:48:33 +0000
21@@ -25,14 +25,13 @@
22 return;
23 }
24 var picker_span = show_widget_node.get('parentNode');
25- var new_node = Y.Node.create('<span>(<a href="#"></a>)</span>');
26- show_widget_node = new_node.one('a');
27- show_widget_node
28- .set('id', show_widget_id)
29- .addClass('js-action')
30- .set('text', 'Choose\u2026');
31+ show_widget_node = Y.Node.create(
32+ '<a href="#" class="sprite search-icon action-icon js-action">' +
33+ 'Choose\u2026' +
34+ '</a>');
35+ show_widget_node.set('id', show_widget_id);
36 picker_span.empty();
37- picker_span.appendChild(new_node);
38+ picker_span.appendChild(show_widget_node);
39 picker_span.removeClass('hidden');
40 show_widget_node.on('click', function (e) {
41 if (picker === null) {