Merge lp:~bac/launchpad/bug-568659 into lp:launchpad

Proposed by Brad Crittenden on 2010-04-26
Status: Merged
Approved by: Eleanor Berger on 2010-04-26
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~bac/launchpad/bug-568659
Merge into: lp:launchpad
Diff against target: 25 lines (+5/-0)
2 files modified
lib/lp/registry/browser/product.py (+1/-0)
lib/lp/registry/browser/tests/product-portlet-packages-view.txt (+4/-0)
To merge this branch: bzr merge lp:~bac/launchpad/bug-568659
Reviewer Review Type Date Requested Status
Eleanor Berger (community) 2010-04-26 Approve on 2010-04-26
Review via email: mp+24131@code.launchpad.net

Commit Message

Don't let package portlet set focus.

Description of the Change

= Summary =

The product package portlet lives towards the bottom of the product
index page and is currently stealing focus, which causes the page to
scroll needlessly and annoyingly.

== Proposed fix ==

Set 'initial_focus_widget' to None to avoid the scroll.

== Pre-implementation notes ==

None.

== Implementation details ==

As above.

== Tests ==

bin/test -vvt product-portlet-packages-view.txt

== Demo and Q/A ==

Go to a product on launchpad.net that does not have a package and ensure
the page doesn't scroll.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/browser/product.py
  lib/lp/registry/browser/tests/product-portlet-packages-view.txt

== Pyflakes Doctest notices ==

lib/lp/registry/browser/tests/product-portlet-packages-view.txt
    30: local variable 'ignore' is assigned to but never used

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/browser/product.py'
2--- lib/lp/registry/browser/product.py 2010-04-24 02:41:03 +0000
3+++ lib/lp/registry/browser/product.py 2010-04-27 00:46:27 +0000
4@@ -1050,6 +1050,7 @@
5 suggestions = None
6 max_suggestions = 8
7 other_package = object()
8+ initial_focus_widget = None
9
10 @cachedproperty
11 def sourcepackages(self):
12
13=== modified file 'lib/lp/registry/browser/tests/product-portlet-packages-view.txt'
14--- lib/lp/registry/browser/tests/product-portlet-packages-view.txt 2010-04-14 17:16:56 +0000
15+++ lib/lp/registry/browser/tests/product-portlet-packages-view.txt 2010-04-27 00:46:27 +0000
16@@ -49,6 +49,10 @@
17 >>> print view.suggestions
18 []
19
20+The view does not set focus to its form otherwise it will cause the page to scroll.
21+ >>> view.focusedElementScript()
22+ ''
23+
24 No distribution source packages match so the user is shown an
25 appropriate message asking to suggest a match.
26