Merge lp:~gmb/launchpad/fix-opera-spacing-bug-401130 into lp:launchpad/db-devel

Proposed by Graham Binns
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~gmb/launchpad/fix-opera-spacing-bug-401130
Merge into: lp:launchpad/db-devel
Diff against target: None lines
To merge this branch: bzr merge lp:~gmb/launchpad/fix-opera-spacing-bug-401130
Reviewer Review Type Date Requested Status
Gavin Panella (community) js Approve
Review via email: mp+9146@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) wrote :

A fix for a spacing issue with duplicate collapsibles in Opera.

Revision history for this message
Gavin Panella (allenap) :
review: Approve (js)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js'
2--- lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-07-17 00:26:05 +0000
3+++ lib/canonical/launchpad/javascript/bugs/filebug-dupefinder.js 2009-07-22 16:42:10 +0000
4@@ -193,11 +193,6 @@
5
6 if (bug_already_reported_expanders !== null &&
7 bug_already_reported_expanders !== undefined) {
8- // Collapse all the details divs, since we don't want them
9- // expanded first up.
10- Y.each(Y.all('div.duplicate-details'), function(div) {
11- collapse_bug_details(div);
12- });
13
14 // Set up the onclick handlers for the expanders.
15 Y.each(Y.all('.similar-bug'), function(row) {
16@@ -206,6 +201,18 @@
17 var bug_title_link = row.query('.duplicate-bug-link');
18 var view_bug_link = row.query('.view-bug-link');
19
20+ // Grab the initial height of the element and create a
21+ // config for the slide_out animation. This allows us to
22+ // deal with browsers like Opera in which the JS engine
23+ // takes a punt at the right height for the slid-out
24+ // drawer and gets it completely and utterly wrong.
25+ var initial_height = bug_details_div.get('scrollHeight');
26+ var slide_out_config = {
27+ to: {
28+ height: initial_height
29+ }
30+ };
31+
32 // Shut down the default action for the link and mark it
33 // as a JS'd link. We do this as it's simpler than
34 // trying to find all the bits of the row that we want
35@@ -233,7 +240,8 @@
36 // tabbing will expand the different bugs.
37 bug_title_link.on('focus', function(e) {
38 if (!bug_details_div.hasClass('lazr-opened')) {
39- var anim = Y.lazr.effects.slide_out(bug_details_div);
40+ var anim = Y.lazr.effects.slide_out(
41+ bug_details_div, slide_out_config);
42 anim.run();
43
44 image.set(SRC, EXPANDER_EXPANDED);
45@@ -249,7 +257,8 @@
46 if (bug_details_div.hasClass('lazr-opened')) {
47 collapse_bug_details(image);
48 } else {
49- var anim = Y.lazr.effects.slide_out(bug_details_div);
50+ var anim = Y.lazr.effects.slide_out(
51+ bug_details_div, slide_out_config);
52 anim.run();
53
54 image.set(SRC, EXPANDER_EXPANDED);
55@@ -264,6 +273,13 @@
56
57 // Hide the bug reporting form.
58 bug_reporting_form.setStyle(DISPLAY, NONE);
59+
60+ // Collapse all the details divs, since we don't want them
61+ // expanded first up.
62+ Y.each(Y.all('div.duplicate-details'), function(div) {
63+ collapse_bug_details(div);
64+ });
65+
66 }
67
68 bug_not_reported_button = Y.get('#bug-not-already-reported');

Subscribers

People subscribed via source and target branches

to status/vote changes: