← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~benji/launchpad/fix-help-link-3 into lp:launchpad/db-devel

 

Benji York has proposed merging lp:~benji/launchpad/fix-help-link-3 into lp:launchpad/db-devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~benji/launchpad/fix-help-link-3/+merge/58524

This branch fixes a small bug: the help link next to the "Stop my emails
from this subscription" link wasn't appearing on Chrome. I'm still not
sure why not, but the work-around was simple enough.
-- 
https://code.launchpad.net/~benji/launchpad/fix-help-link-3/+merge/58524
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~benji/launchpad/fix-help-link-3 into lp:launchpad/db-devel.
=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
--- lib/lp/registry/javascript/structural-subscription.js	2011-04-19 07:18:42 +0000
+++ lib/lp/registry/javascript/structural-subscription.js	2011-04-20 15:47:26 +0000
@@ -1204,8 +1204,9 @@
         var mute_link = node.one('a.mute-subscription');
         mute_link.on('click', make_mute_handler(filter_info, node));
     }
-    if (!filter_info.subscriber_is_team ||
-        filter_info.user_is_team_admin) {
+    var can_edit = (!filter_info.subscriber_is_team ||
+                    filter_info.user_is_team_admin);
+    if (can_edit) {
         var edit_link = node.one('a.edit-subscription');
         var edit_handler = make_edit_handler(
             subscription, filter_info, filter_id, config);
@@ -1276,9 +1277,6 @@
                 'do not receive emails from this subscription.</em>'));
     }
 
-    var can_edit = (!filter_info.subscriber_is_team ||
-                    filter_info.user_is_team_admin);
-
     var control = filter_node.appendChild(
         Y.Node.create('<span style="float: right"></span>'));
 
@@ -1291,6 +1289,9 @@
             '    href="/+help/structural-subscription-mute.html">'+
             '  <span class="invisible-link">Delivery help</span>'+
             '</a>'));
+        // For some reason the help link will not appear in Chrome unless
+        // there is a non-empty element immediately after the help node.
+        control.append(Y.Node.create('<span>&nbsp;</span>'));
         // We store a reference to the timeout that will hide the help link so
         // we can cancel it if needed.
         var hide_help_timeout;
@@ -1309,6 +1310,9 @@
         link.on('hover', show_help, hide_help);
         help.on('hover', show_help, hide_help);
     }
+
+    var can_edit = (!filter_info.subscriber_is_team ||
+                    filter_info.user_is_team_admin);
     if (can_edit) {
         // User can edit the subscription.
         control.append(Y.Node.create(