Merge lp:~rockstar/launchpad/bug-517266 into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/bug-517266
Merge into: lp:launchpad
Diff against target: 26 lines (+9/-7)
1 file modified
lib/canonical/launchpad/javascript/code/popupdiff.js (+9/-7)
To merge this branch: bzr merge lp:~rockstar/launchpad/bug-517266
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+19730@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hi Aaron-

  So, this is a change to the popupdiff info on the bugs page. Basically, if
the diff has no lines of difference, there won't be a node for 'a.diff-link'.
In those cases, we have nothing to highlight or attach events to.

  I don't think we can test this other than actually walking through it by
hand. Windmill doesn't have a way to say "There aren't any errors in the
browser, right?"

Cheers,
Paul

Revision history for this message
Aaron Bentley (abentley) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 merge approve

> I don't think we can test this other than actually walking through it by
> hand. Windmill doesn't have a way to say "There aren't any errors in the
> browser, right?"

There might be a way to say "this was never called", but I think it's
fine to land like this.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkt+6AIACgkQ0F+nu1YWqI0TpQCfXQ17r/8Al7+bHuTFwN+DAXBP
WeEAn1ug77anicvtZ8C9SKCpITs8MVSF
=XT8J
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/javascript/code/popupdiff.js'
2--- lib/canonical/launchpad/javascript/code/popupdiff.js 2009-11-19 08:17:29 +0000
3+++ lib/canonical/launchpad/javascript/code/popupdiff.js 2010-02-19 17:48:18 +0000
4@@ -99,13 +99,15 @@
5 */
6 function link_popup_diff_onclick(node) {
7 var a = node.query('a.diff-link');
8- a.addClass('js-action');
9- var librarian_url = a.getAttribute('href');
10- var api_url = node.query('a.api-ref').getAttribute('href');
11- a.on('click', function(e) {
12- e.preventDefault();
13- display_diff(a, api_url, librarian_url);
14- });
15+ if (Y.Lang.isValue(a)) {
16+ a.addClass('js-action');
17+ var librarian_url = a.getAttribute('href');
18+ var api_url = node.query('a.api-ref').getAttribute('href');
19+ a.on('click', function(e) {
20+ e.preventDefault();
21+ display_diff(a, api_url, librarian_url);
22+ });
23+ }
24 }
25
26 /*