Merge lp:~huwshimi/launchpad/bug-listing-spinner-position-904416 into lp:launchpad

Proposed by Huw Wilkins
Status: Merged
Approved by: Huw Wilkins
Approved revision: no longer in the source branch.
Merged at revision: 14533
Proposed branch: lp:~huwshimi/launchpad/bug-listing-spinner-position-904416
Merge into: lp:launchpad
Diff against target: 64 lines (+5/-23)
2 files modified
lib/lp/app/javascript/indicator/assets/indicator-core.css (+5/-4)
lib/lp/app/javascript/indicator/indicator.js (+0/-19)
To merge this branch: bzr merge lp:~huwshimi/launchpad/bug-listing-spinner-position-904416
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+85997@code.launchpad.net

Commit message

[r=adeuring][bug=904416] Repositioned the loading spinner on bug listings to the top.

Description of the change

The spinner that was shown when a bug listing was loading was centered vertically on the listing. This meant that for long listings the spinner was never visible.

This branch moves the spinner to the top of the list. This means the spinner will be visible when the ordering and top pagination controls are used. Unfortunately this means the spinner still won't be visible when the bottom pagination controls are used on long listings, but I feel this is a big enough improvement to consider the fix good enough for now.

Here is a screenshot of the new position: https://launchpadlibrarian.net/87618550/spinner_position.png

The JavaScript code that is removed in this branch is what was previously used to position the spinner. CSS now positions the spinner.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
review: Approve (code)
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

Couldn't position relative to the viewport instead of the content, so that it's always visible?

Revision history for this message
Huw Wilkins (huwshimi) wrote :

Hi Francis,

That's certainly a possibility, do you mean that it would follow the viewport if you scroll or that it is initially positioned in relation to the viewport?

Revision history for this message
Francis J. Lacoste (flacoste) wrote :

I was thinking always positioning it in relation to the viewport. But on the checkpoint call, Rick and Deryck explained that this would be kind of messy because the current interaction grays out the underlying the listing div. So you'd need to position it relative to the intersection of the viewport and the div. Otherwise, the interaction would need to be redesigned to be independent of the div.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/javascript/indicator/assets/indicator-core.css'
2--- lib/lp/app/javascript/indicator/assets/indicator-core.css 2011-12-01 21:46:27 +0000
3+++ lib/lp/app/javascript/indicator/assets/indicator-core.css 2011-12-16 06:40:30 +0000
4@@ -6,11 +6,12 @@
5 z-index: 999;
6 }
7
8+.yui3-overlay-indicator-content {
9+ text-align: center;
10+ }
11+
12 .yui3-overlay-indicator img {
13- display: block;
14- margin: auto;
15- max-width: 100%;
16- position: absolute;
17+ margin-top: 8em;
18 }
19
20 .yui3-overlay-indicator-hidden {
21
22=== modified file 'lib/lp/app/javascript/indicator/indicator.js'
23--- lib/lp/app/javascript/indicator/indicator.js 2011-12-06 16:05:36 +0000
24+++ lib/lp/app/javascript/indicator/indicator.js 2011-12-16 06:40:30 +0000
25@@ -13,10 +13,6 @@
26 */
27 YUI().add('lp.indicator', function (Y) {
28
29- // Our spinner is 32px; we use this for calculating the center position of
30- // the spinner within the overlay div.
31- var SPINNER_SIZE = 32;
32-
33 var props = {
34 ATTRS: {
35 /**
36@@ -56,17 +52,6 @@
37
38 var config = {
39
40- /**
41- * Calculate the padding we need to use to center the spinner.
42- */
43- _calc_image_padding: function (dim) {
44- var boundingBox = this.get('boundingBox');
45- var content_dimension =
46- boundingBox.getStyle(dim).replace('px', '');
47- return content_dimension > SPINNER_SIZE ?
48- (content_dimension - SPINNER_SIZE) / 2 : 0;
49- },
50-
51 initializer: function(cfg) {
52 this.hide();
53 },
54@@ -133,10 +118,6 @@
55 boundingBox.set('offsetHeight', height);
56 // Now do position too.
57 boundingBox.setXY(target.getXY());
58- // Update the padding on the image to fit.
59- var img = boundingBox.one('img');
60- img.setStyle('top', this._calc_image_padding('height') + 'px');
61- img.setStyle('left', this._calc_image_padding('width') + 'px');
62 },
63
64 /**