diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js index 2c9a3231a322..7b4cf7a3b944 100644 --- a/mail/components/compose/content/MsgComposeCommands.js +++ b/mail/components/compose/content/MsgComposeCommands.js @@ -1316,7 +1316,10 @@ function ComposeStartup(recycled, aParams) // Force color picker on toolbar to show document colors onFontColorChange(); onBackgroundColorChange(); - } + } + + // reset the priorty field for recycled windows + updatePriorityToolbarButton('normal'); } else { @@ -1842,21 +1845,39 @@ function MessageFcc(menuItem) } } } + +function updatePriorityMenu() +{ + if (gMsgCompose) + { + var msgCompFields = gMsgCompose.compFields; + if (msgCompFields && msgCompFields.priority) + { + var priorityMenu = document.getElementById('priorityMenu' ); + priorityMenu.getElementsByAttribute( "checked", 'true' )[0].removeAttribute('checked'); + priorityMenu.getElementsByAttribute( "value", msgCompFields.priority )[0].setAttribute('checked', 'true'); + } + + } +} + +function updatePriorityToolbarButton(newPriorityValue) +{ + var prioritymenu = document.getElementById('priorityMenu-button'); + if (prioritymenu) + prioritymenu.value = newPriorityValue; +} function PriorityMenuSelect(target) { if (gMsgCompose) { var msgCompFields = gMsgCompose.compFields; - if (msgCompFields) - switch (target.getAttribute('id')) - { - case "priority_lowest": msgCompFields.priority = "lowest"; break; - case "priority_low": msgCompFields.priority = "low"; break; - case "priority_normal": msgCompFields.priority = "normal"; break; - case "priority_high": msgCompFields.priority = "high"; break; - case "priotity_highest": msgCompFields.priority = "highest"; break; - } + if (msgCompFields) + msgCompFields.priority = target.getAttribute('value'); + + // keep priority toolbar button in synch with possible changes via the menu item + updatePriorityToolbarButton(target.getAttribute('value')); } } diff --git a/mail/components/compose/content/messengercompose.xul b/mail/components/compose/content/messengercompose.xul index ea7417be2acf..17702f7ce911 100644 --- a/mail/components/compose/content/messengercompose.xul +++ b/mail/components/compose/content/messengercompose.xul @@ -380,13 +380,13 @@ - + - - - - - + + + + + + + + + - + + - + +