Commit ba276783 authored by mscott%netscape.com's avatar mscott%netscape.com
Browse files

Bug #112220 avoid an extra firing of the on select outliner handler when deleting

a message. Supress command updating when selecting the next message
after a delete
r=bienvenu
rs=sspitzer
parent 04beaa29
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -269,14 +269,14 @@ function HandleDeleteOrMoveMsgCompleted(folder)
      // optimize away.
      if (gNextMessageViewIndexAfterDelete != -1) 
      {
        // when deleting a message we don't update the commands when the selection goes 0
        // (we have a hack in nsMsgDBView which prevents that update) so there is no need to
        // update commands when we select the next message after the delete the commands already
        // have the right update state...
        gDBView.suppressCommandUpdating = true;
        outlinerSelection.select(gNextMessageViewIndexAfterDelete);
        // since gNextMessageViewIndexAfterDelete probably has the same value
        // as the last index we had selected, the outliner isn't generating a new
        // selectionChanged notification for the outliner view. So we aren't loading the 
        // next message. to fix this, force the selection changed update.
        if (outlinerView)
          outlinerView.selectionChanged();
        EnsureRowInThreadOutlinerIsVisible(gNextMessageViewIndexAfterDelete); 
        gDBView.suppressCommandUpdating = false;
      }
      else 
      {