зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 109209. Don't erase actual flags when disabling/enabling the editor widget. Did also some cleanup for safe code. R=dmose, SR=bienvenu
This commit is contained in:
Родитель
be77e6966c
Коммит
534ed8ad12
|
@ -144,7 +144,9 @@ function ReleaseGlobalVariables()
|
||||||
|
|
||||||
function disableEditableFields()
|
function disableEditableFields()
|
||||||
{
|
{
|
||||||
editorShell.editor.SetFlags(nsIPlaintextEditor.eEditorReadonlyMask);
|
var flags = new Object;
|
||||||
|
editorShell.editor.GetFlags(flags);
|
||||||
|
editorShell.editor.SetFlags(flags.value | nsIPlaintextEditor.eEditorReadonlyMask);
|
||||||
var disableElements = document.getElementsByAttribute("disableonsend", "true");
|
var disableElements = document.getElementsByAttribute("disableonsend", "true");
|
||||||
for (i=0;i<disableElements.length;i++)
|
for (i=0;i<disableElements.length;i++)
|
||||||
{
|
{
|
||||||
|
@ -154,7 +156,9 @@ function disableEditableFields()
|
||||||
|
|
||||||
function enableEditableFields()
|
function enableEditableFields()
|
||||||
{
|
{
|
||||||
editorShell.editor.SetFlags(nsIPlaintextEditor.eEditorMailMask);
|
var flags = new Object;
|
||||||
|
editorShell.editor.GetFlags(flags);
|
||||||
|
editorShell.editor.SetFlags(flags.value ^ nsIPlaintextEditor.eEditorReadonlyMask);
|
||||||
var enableElements = document.getElementsByAttribute("disableonsend", "true");
|
var enableElements = document.getElementsByAttribute("disableonsend", "true");
|
||||||
for (i=0;i<enableElements.length;i++)
|
for (i=0;i<enableElements.length;i++)
|
||||||
{
|
{
|
||||||
|
@ -185,10 +189,9 @@ var gComposeRecyclingListener = {
|
||||||
},
|
},
|
||||||
|
|
||||||
onReopen: function(params) {
|
onReopen: function(params) {
|
||||||
dump("This is a recycled compose window!\n");
|
|
||||||
InitializeGlobalVariables();
|
InitializeGlobalVariables();
|
||||||
enableEditableFields();
|
|
||||||
window.editorShell.contentWindow.focus();
|
window.editorShell.contentWindow.focus();
|
||||||
|
enableEditableFields();
|
||||||
ComposeStartup(true, params);
|
ComposeStartup(true, params);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1142,6 +1145,9 @@ function ComposeStartup(recycled, aParams)
|
||||||
var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object
|
var params = null; // New way to pass parameters to the compose window as a nsIMsgComposeParameters object
|
||||||
var args = null; // old way, parameters are passed as a string
|
var args = null; // old way, parameters are passed as a string
|
||||||
|
|
||||||
|
if (recycled)
|
||||||
|
dump("This is a recycled compose window!\n");
|
||||||
|
|
||||||
if (aParams)
|
if (aParams)
|
||||||
params = aParams;
|
params = aParams;
|
||||||
else
|
else
|
||||||
|
@ -1251,7 +1257,7 @@ function ComposeStartup(recycled, aParams)
|
||||||
// set the close listener
|
// set the close listener
|
||||||
gMsgCompose.recyclingListener = gComposeRecyclingListener;
|
gMsgCompose.recyclingListener = gComposeRecyclingListener;
|
||||||
|
|
||||||
//Lets the compose object know that we are dealing with a recycled window
|
//Lets the compose object knows that we are dealing with a recycled window
|
||||||
gMsgCompose.recycledWindow = recycled;
|
gMsgCompose.recycledWindow = recycled;
|
||||||
|
|
||||||
//Creating a Editor Shell
|
//Creating a Editor Shell
|
||||||
|
@ -1408,11 +1414,13 @@ function ComposeUnload()
|
||||||
{
|
{
|
||||||
dump("\nComposeUnload from XUL\n");
|
dump("\nComposeUnload from XUL\n");
|
||||||
RemoveMessageComposeOfflineObserver();
|
RemoveMessageComposeOfflineObserver();
|
||||||
RemoveDirectoryServerObserver(null);
|
RemoveDirectoryServerObserver(null);
|
||||||
|
if (gCurrentIdentity)
|
||||||
RemoveDirectoryServerObserver("mail.identity." + gCurrentIdentity.key);
|
RemoveDirectoryServerObserver("mail.identity." + gCurrentIdentity.key);
|
||||||
if (gCurrentAutocompleteDirectory)
|
if (gCurrentAutocompleteDirectory)
|
||||||
RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory);
|
RemoveDirectorySettingsObserver(gCurrentAutocompleteDirectory);
|
||||||
gMsgCompose.UnregisterStateListener(stateListener);
|
if (gMsgCompose)
|
||||||
|
gMsgCompose.UnregisterStateListener(stateListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetDocumentCharacterSet(aCharset)
|
function SetDocumentCharacterSet(aCharset)
|
||||||
|
@ -2567,4 +2575,3 @@ function DisplaySaveFolderDlg(folderURI)
|
||||||
}//if
|
}//if
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче