← Back to team overview

launchpad-reviewers team mailing list archive

lp:~jcsackett/launchpad/picker-expansion-still-aint-good-enough into lp:launchpad

 

j.c.sackett has proposed merging lp:~jcsackett/launchpad/picker-expansion-still-aint-good-enough into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/picker-expansion-still-aint-good-enough/+merge/74653


Summary
=======
This branch moves the expander section on the picker entry to the second line for each entry. The first row now allows you to select the entry. This is to address the complaints of people who do not need the extra information to make the selection, and do not wish to click once to expand before being able to select.

Preimp
======
Spoke with Curtis Hovey

Implementation
==============
The first row of the picker entry has the standard picker save code attached to its click event.

The second row is made as the expansion node for the expander. Since some entries do not have an email address (which is the text displayed in the second row), the picker now checks if there is text in the expandable row and sets the text to "More information ..." if not, so as to make it clear that there is data to expand to see.

The remaining behavior of the picker is unaltered.

Tests
=====
bin/test -vvc --layer=YUI

QA
==
Confirm the first row of an entry is clickable, and selects the person.

Confirm the second row is clickable, and expands the details section.

Lint
====
./lib/lp/app/javascript/picker/picker.js
      70: 'Picker' has not been fully defined yet.

This is okay; it's an artifact of how the prototyping works.

-- 
https://code.launchpad.net/~jcsackett/launchpad/picker-expansion-still-aint-good-enough/+merge/74653
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/picker-expansion-still-aint-good-enough into lp:launchpad.
=== modified file 'lib/lp/app/javascript/picker/picker.js'
--- lib/lp/app/javascript/picker/picker.js	2011-09-05 00:22:35 +0000
+++ lib/lp/app/javascript/picker/picker.js	2011-09-08 17:38:54 +0000
@@ -573,16 +573,21 @@
             if (li_badges !== null) {
                 li.appendChild(li_badges);
             }
-            var summary_node = Y.Node.create('<div></div>');
-            summary_node.appendChild(li_title);
-            summary_node.appendChild(li_desc);
-            li.appendChild(summary_node);
+            li.appendChild(li_title);
+            li.appendChild(li_desc);
             if (li_details) {
                 // Use explicit save link.
+                li_title.setStyle('padding-left', '18px');
+                if (li_desc.get('text') === '') {
+                    li_desc.set('text', 'More information...');
+                }
                 li.appendChild(li_details);
                 li.expander = new Y.lp.app.widgets.expander.Expander(
-                    summary_node, li_details, {group_id: expander_id});
+                    li_desc, li_details, {group_id: expander_id});
                 li.expander.setUp();
+                li_title.on('click', function (e, value) {
+                    this.fire(SAVE, value);
+                    }, this, data);
             } else {
                 // Attach implicit save handler.
                 li.on('click', function (e, value) {