mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-07 21:43:24 +00:00
For SaveAsCharset dialog, make sure the title string is always set if it's not null, check in for jbetak, bug 44323, r=cmanske,nhotta, sr=alecf.
This commit is contained in:
parent
1b72130400
commit
3c04234e4c
@ -374,7 +374,15 @@ var nsSaveAsCharsetCommand =
|
||||
FinishHTMLSource();
|
||||
window.ok = false;
|
||||
window.exportToText = false;
|
||||
window.openDialog("chrome://editor/content/EditorSaveAsCharset.xul","_blank", "chrome,close,titlebar,modal,resizable=yes")
|
||||
window.openDialog("chrome://editor/content/EditorSaveAsCharset.xul","_blank", "chrome,close,titlebar,modal,resizable=yes");
|
||||
|
||||
if (window.newTitle != null) {
|
||||
try {
|
||||
editorShell.SetDocumentTitle(window.newTitle);
|
||||
}
|
||||
catch (ex) {}
|
||||
}
|
||||
|
||||
if (window.ok)
|
||||
{
|
||||
if (window.exportToText)
|
||||
@ -386,6 +394,7 @@ var nsSaveAsCharsetCommand =
|
||||
window.ok = window.editorShell.saveDocument(true, false, editorShell.contentsMIMEType);
|
||||
}
|
||||
}
|
||||
|
||||
window._content.focus();
|
||||
return window.ok;
|
||||
}
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
var charsetList = new Array();
|
||||
var charsetDict = new Array();
|
||||
var title="";
|
||||
var charset="";
|
||||
var titleWasEdited = false;
|
||||
var charsetWasChanged = false;
|
||||
@ -88,15 +87,8 @@ function InitDialog() {
|
||||
|
||||
function onOK()
|
||||
{
|
||||
if(ValidateData())
|
||||
{
|
||||
editorShell.BeginBatchChanges();
|
||||
|
||||
if(titleWasEdited) {
|
||||
try {
|
||||
editorShell.SetDocumentTitle(title);
|
||||
} catch (ex) {}
|
||||
}
|
||||
editorShell.BeginBatchChanges();
|
||||
|
||||
if(charsetWasChanged)
|
||||
{
|
||||
@ -106,13 +98,15 @@ function onOK()
|
||||
|
||||
editorShell.EndBatchChanges();
|
||||
|
||||
if(titleWasEdited) {
|
||||
window.opener.newTitle = dialog.TitleInput.value.trimString();
|
||||
}
|
||||
|
||||
window.opener.ok = true;
|
||||
window.opener.exportToText = dialog.exportToText.checked;
|
||||
SaveWindowLocation();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function LoadAvailableCharSets()
|
||||
{
|
||||
@ -219,12 +213,6 @@ function SelectCharset()
|
||||
}
|
||||
}
|
||||
|
||||
function ValidateData()
|
||||
{
|
||||
title=dialog.TitleInput.value.trimString();
|
||||
return true;
|
||||
}
|
||||
|
||||
function TitleChanged()
|
||||
{
|
||||
titleWasEdited = true;
|
||||
|
Loading…
Reference in New Issue
Block a user