зеркало из https://github.com/mozilla/gecko-dev.git
fix for #8219. only honor delete of a news message (cancel) when from the menu.
This commit is contained in:
Родитель
54762c7045
Коммит
ea91269dfa
|
@ -301,7 +301,7 @@ Rights Reserved.
|
|||
<menuitem name="&cutCmd.label;" onclick="MsgEditCut();"/>
|
||||
<menuitem name="©Cmd.label;" onclick="MsgEditCopy();"/>
|
||||
<menuitem name="&pasteCmd.label;" onclick="MsgEditPaste();"/>
|
||||
<menuitem name="&deleteMsgCmd.label;" onclick="MsgDeleteMessage();"/>
|
||||
<menuitem name="&deleteMsgCmd.label;" onclick="MsgDeleteMessage(false);"/>
|
||||
<menuitem name="&deleteFolderCmd.label;" onclick="MsgDeleteFolder();"/>
|
||||
<menu name="&selectMenu.label;">
|
||||
<menuitem name="&selectAllCmd.label;" onclick="MsgSelectAll();"/>
|
||||
|
@ -510,7 +510,7 @@ Rights Reserved.
|
|||
<titledbutton src="&newMsgButton.img;" align="bottom" value="&newMsgButton.label;" onclick="MsgNewMessage()"/>
|
||||
<titledbutton src="&replyButton.img;" align="bottom" value="&replyButton.label;" onclick="MsgReplyMessage()"/>
|
||||
<titledbutton src="&forwardButton.img;" align="bottom" value="&forwardButton.label;" onclick="MsgForwardMessage()"/>
|
||||
<titledbutton src="&deleteButton.img;" align="bottom" value="&deleteButton.label;" onclick="MsgDeleteMessage()"/>
|
||||
<titledbutton src="&deleteButton.img;" align="bottom" value="&deleteButton.label;" onclick="MsgDeleteMessage(true)"/>
|
||||
|
||||
<spring flex="100%"/>
|
||||
<titledbutton src="&throbber.img;" align="right" onclick="MsgHome('&throbber.url;')"/>
|
||||
|
|
|
@ -56,17 +56,29 @@ function MsgGetMessage()
|
|||
GetNewMessages();
|
||||
}
|
||||
|
||||
function MsgDeleteMessage()
|
||||
function MsgDeleteMessage(fromToolbar)
|
||||
{
|
||||
dump("\nMsgDeleteMessage from XUL\n");
|
||||
//dump("from toolbar? " + fromToolbar + "\n");
|
||||
|
||||
var tree = GetThreadTree();
|
||||
if(tree) {
|
||||
dump("tree is valid\n");
|
||||
//get the selected elements
|
||||
var messageList = tree.getElementsByAttribute("selected", "true");
|
||||
//get the current folder
|
||||
var srcFolder = GetThreadTreeFolder();
|
||||
messenger.DeleteMessages(tree, srcFolder, messageList);
|
||||
// if from the toolbar, return right away if this is a news message
|
||||
// only allow cancel from the menu: "Edit | Cancel / Delete Message"
|
||||
if (fromToolbar) {
|
||||
uri = srcFolder.getAttribute('id');
|
||||
//dump("uri[0:6]=" + uri.substring(0,6) + "\n");
|
||||
if (uri.substring(0,6) == "news:/") {
|
||||
//dump("delete ignored!\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
dump("tree is valid\n");
|
||||
//get the selected elements
|
||||
var messageList = tree.getElementsByAttribute("selected", "true");
|
||||
//get the current folder
|
||||
messenger.DeleteMessages(tree, srcFolder, messageList);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче