← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~gary/launchpad/bug-772763-remove-unmute-dialog into lp:launchpad/db-devel

 

Gary Poster has proposed merging lp:~gary/launchpad/bug-772763-remove-unmute-dialog into lp:launchpad/db-devel with lp:~danilo/launchpad/bug-772763-remove-unmute-dialog as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~gary/launchpad/bug-772763-remove-unmute-dialog/+merge/61806

This branch addresses the review comments from https://code.launchpad.net/~danilo/launchpad/bug-772763-remove-unmute-dialog/+merge/61780 to handle the case when an unmute moves the subscriber list from "no subscribers" to showing a subscriber.  Before, the unmuted subscriber would be shown in addition to "no subscribers".  Now, "no subscribers" disappears when appropriate.

I added a green flash to any newly added item in the subscriber list because it made this particular case look better balanced (since muting also uses a green flash on the muted subscriber) and because I thought it was generally appropriate for our UI patterns.

Thank you

Gary
-- 
https://code.launchpad.net/~gary/launchpad/bug-772763-remove-unmute-dialog/+merge/61806
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gary/launchpad/bug-772763-remove-unmute-dialog into lp:launchpad/db-devel.
=== modified file 'lib/lp/bugs/javascript/bugtask_index_portlets.js'
--- lib/lp/bugs/javascript/bugtask_index_portlets.js	2011-05-20 17:34:30 +0000
+++ lib/lp/bugs/javascript/bugtask_index_portlets.js	2011-05-20 17:34:32 +0000
@@ -564,16 +564,17 @@
         if (next) {
             subscribers.insertBefore(link_node, next);
         } else {
-            // Handle the case of no subscribers.
-            var none_subscribers = Y.one('#none-subscribers');
-            if (none_subscribers) {
-                var none_parent = none_subscribers.get('parentNode');
-                none_parent.removeChild(none_subscribers);
-            }
             subscribers.appendChild(link_node);
         }
     }
-
+    // Handle the case of no previous subscribers.
+    var none_subscribers = Y.one('#none-subscribers');
+    if (none_subscribers) {
+        var none_parent = none_subscribers.get('parentNode');
+        none_parent.removeChild(none_subscribers);
+    }
+    // Highlight the new addition with a green flash.
+    Y.lazr.anim.green_flash({ node: link_node }).run();
     // Set the click handler if adding a remove icon.
     if (subscription.can_be_unsubscribed_by_user()) {
         var remove_icon =