Merge lp:~jcsackett/launchpad/picker-buttons-should-disappear into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13339 |
Proposed branch: | lp:~jcsackett/launchpad/picker-buttons-should-disappear |
Merge into: | lp:launchpad |
Diff against target: |
108 lines (+54/-3) 2 files modified
lib/lp/app/javascript/tests/test_personpicker.js (+38/-0) lib/lp/app/javascript/widgets.js (+16/-3) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/picker-buttons-should-disappear |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+65562@code.launchpad.net |
Commit message
[bug=798778] [r=allenap] Hides the extra buttons on personpicker when a search is made.
Description of the change
Summary
=======
Personpicker introduces assign me and remove assignee buttons to all person assigning activities. However, it's confusing to see the assign me and remove me buttons when there are results from a search in the picker.
This branch makes the buttons disappear if there are search results, but provides the buttons if no results are found, in which case one might concievably want to assign one's self.
Proposed fix
============
Using the YUI event model, we want to detect the presence of results and hide the extra buttons if they exist after results are loaded.
Pre-implementation notes
=======
Spoke with Curtis Hovey, explaining likely implementation.
Implementation details
=======
The personpicker now has overrided the picker's bindUI call, adding a section that creates a handler for the 'resultChange' event fired by the picker. This handler checks for the result condition (e.g. are there results, and was a search done) and determines whether to apply the unseen class to the extra buttons based on that information.
There are also some drive by fixes to the method invocations in personpicker, to make better use of the YUI event and widget model.
Tests
=====
firefox lib/lp/
Demo and Q/A
============
Do a search with the personpicker (e.g. on launchpad.
Lint
====
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
14: 'Picker' has not been fully defined yet.
79: 'PersonPicker' has not been fully defined yet.
The errors can be ignored as they're part of the javascript extension.