Bug 1267469 - New message invoked from news: URL starts in "Body Text" mode, replies allow undoing <p> insertion. r=jorgk a=jorgk CLOSED TREE
authorrsx11m <rsx11m.pub@gmail.com>
Mon, 25 Apr 2016 18:16:49 -0500
changeset 24857 57fb42dfadae9cd694ca42cf61dea911f291797d
parent 24856 2146667144bc14cbe137f240b2213b2eb8e187a4
child 24858 8f82f4732052f269ac2f5a42d6989006398e2a2e
push id1657
push userclokep@gmail.com
push dateMon, 06 Jun 2016 19:50:21 +0000
treeherdercomm-beta@9fac989284b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk, jorgk
bugs1267469
Bug 1267469 - New message invoked from news: URL starts in "Body Text" mode, replies allow undoing <p> insertion. r=jorgk a=jorgk CLOSED TREE
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -275,16 +275,17 @@ var stateListener = {
     updateSendCommands(true);
   },
 
   NotifyComposeBodyReady: function() {
     // Look all the possible compose types (nsIMsgComposeParams.idl):
     switch (gComposeType) {
 
     case Components.interfaces.nsIMsgCompType.New:
+    case Components.interfaces.nsIMsgCompType.NewsPost:
     case Components.interfaces.nsIMsgCompType.ForwardAsAttachment:
       this.NotifyComposeBodyReadyNew();
       break;
 
     case Components.interfaces.nsIMsgCompType.Reply:
     case Components.interfaces.nsIMsgCompType.ReplyAll:
     case Components.interfaces.nsIMsgCompType.ReplyToSender:
     case Components.interfaces.nsIMsgCompType.ReplyToGroup:
@@ -354,16 +355,18 @@ var stateListener = {
         return;
       }
 
       if (range.startContainer != mailBody) {
         dump("Unexpected selection in NotifyComposeBodyReadyReply\n");
         return;
       }
 
+      editor.enableUndo(false);
+
       // Delete a <br> if we see one.
       let currentNode = mailBody.childNodes[start];
       if (currentNode.nodeName == "BR") {
         mailBody.removeChild(currentNode);
       }
 
       let pElement = editor.createElementWithDefaults("p");
       let brElement = editor.createElementWithDefaults("br");