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

Proposed by Benji York
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: 10456
Proposed branch: lp:~benji/launchpad/fix-help-link-3
Merge into: lp:launchpad/db-devel
Diff against target: 57 lines (+13/-6)
1 file modified
lib/lp/registry/javascript/structural-subscription.js (+13/-6)
To merge this branch: bzr merge lp:~benji/launchpad/fix-help-link-3
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+58524@code.launchpad.net

Commit message

[r=abentley][no-qa] fix help link visibility in Chrome

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

It might make sense to change can_edit to a function to reduce code duplication, but either way, this is fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 16:38:06 +0000
@@ -1193,6 +1193,13 @@
1193}1193}
11941194
1195/**1195/**
1196 * Figure out if the user can edit a particular structural subscription.
1197 */
1198function can_edit(filter_info) {
1199 return !filter_info.subscriber_is_team || filter_info.user_is_team_admin;
1200}
1201
1202/**
1196 * Attach activation (click) handlers to links for a particular filter.1203 * Attach activation (click) handlers to links for a particular filter.
1197 */1204 */
1198function wire_up_edit_links_for_filter(1205function wire_up_edit_links_for_filter(
@@ -1204,8 +1211,7 @@
1204 var mute_link = node.one('a.mute-subscription');1211 var mute_link = node.one('a.mute-subscription');
1205 mute_link.on('click', make_mute_handler(filter_info, node));1212 mute_link.on('click', make_mute_handler(filter_info, node));
1206 }1213 }
1207 if (!filter_info.subscriber_is_team ||1214 if (can_edit(filter_info)) {
1208 filter_info.user_is_team_admin) {
1209 var edit_link = node.one('a.edit-subscription');1215 var edit_link = node.one('a.edit-subscription');
1210 var edit_handler = make_edit_handler(1216 var edit_handler = make_edit_handler(
1211 subscription, filter_info, filter_id, config);1217 subscription, filter_info, filter_id, config);
@@ -1276,9 +1282,6 @@
1276 'do not receive emails from this subscription.</em>'));1282 'do not receive emails from this subscription.</em>'));
1277 }1283 }
12781284
1279 var can_edit = (!filter_info.subscriber_is_team ||
1280 filter_info.user_is_team_admin);
1281
1282 var control = filter_node.appendChild(1285 var control = filter_node.appendChild(
1283 Y.Node.create('<span style="float: right"></span>'));1286 Y.Node.create('<span style="float: right"></span>'));
12841287
@@ -1291,6 +1294,9 @@
1291 ' href="/+help/structural-subscription-mute.html">'+1294 ' href="/+help/structural-subscription-mute.html">'+
1292 ' <span class="invisible-link">Delivery help</span>'+1295 ' <span class="invisible-link">Delivery help</span>'+
1293 '</a>'));1296 '</a>'));
1297 // For some reason the help link will not appear in Chrome unless
1298 // there is a non-empty element immediately after the help node.
1299 control.append(Y.Node.create('<span>&nbsp;</span>'));
1294 // We store a reference to the timeout that will hide the help link so1300 // We store a reference to the timeout that will hide the help link so
1295 // we can cancel it if needed.1301 // we can cancel it if needed.
1296 var hide_help_timeout;1302 var hide_help_timeout;
@@ -1309,7 +1315,8 @@
1309 link.on('hover', show_help, hide_help);1315 link.on('hover', show_help, hide_help);
1310 help.on('hover', show_help, hide_help);1316 help.on('hover', show_help, hide_help);
1311 }1317 }
1312 if (can_edit) {1318
1319 if (can_edit(filter_info)) {
1313 // User can edit the subscription.1320 // User can edit the subscription.
1314 control.append(Y.Node.create(1321 control.append(Y.Node.create(
1315 '<a href="#" style="margin-right: 2em;"'+1322 '<a href="#" style="margin-right: 2em;"'+

Subscribers

People subscribed via source and target branches

to status/vote changes: