зеркало из https://github.com/mozilla/pjs.git
Make setting <title> and <meta> contents undoable transactions. Part of bug 60129, r=brade, sr=sfraser
This commit is contained in:
Родитель
d8898f19d0
Коммит
1bc8bfd119
|
@ -383,7 +383,7 @@ function AppendValueAndDataToMenulist(menulist, valueStr, dataStr)
|
|||
return null;
|
||||
}
|
||||
}
|
||||
menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
|
||||
var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");
|
||||
if (menuItem)
|
||||
{
|
||||
menuItem.setAttribute("value", valueStr);
|
||||
|
@ -926,7 +926,14 @@ function AppendHeadElement(element)
|
|||
{
|
||||
var head = GetHeadElement();
|
||||
if (head)
|
||||
head.appendChild(element);
|
||||
{
|
||||
var position = 0;
|
||||
if (head.hasChildNodes())
|
||||
position = head.childNodes.length;
|
||||
|
||||
// Use editor's undoable transaction
|
||||
editorShell.InsertElement(element, head, position);
|
||||
}
|
||||
}
|
||||
|
||||
function SetWindowLocation()
|
||||
|
|
|
@ -140,6 +140,7 @@ function onOK()
|
|||
{
|
||||
if (ValidateData())
|
||||
{
|
||||
editorShell.BeginBatchChanges();
|
||||
if (titleWasEdited)
|
||||
{
|
||||
// Set title contents even if string is empty
|
||||
|
@ -152,6 +153,8 @@ function onOK()
|
|||
if (descWasEdited)
|
||||
SetMetaElementContent(descriptionElement, description, insertNewDescription);
|
||||
|
||||
editorShell.EndBatchChanges();
|
||||
|
||||
SaveWindowLocation();
|
||||
return true; // do close the window
|
||||
}
|
||||
|
|
|
@ -86,6 +86,8 @@ function onOK()
|
|||
{
|
||||
if(ValidateData())
|
||||
{
|
||||
editorShell.BeginBatchChanges();
|
||||
|
||||
if(titleWasEdited) {
|
||||
editorShell.SetDocumentTitle(title);
|
||||
}
|
||||
|
@ -95,6 +97,9 @@ function onOK()
|
|||
SetMetaElementContent(contenttypeElement, "text/html; charset=" + charset, insertNewContentType);
|
||||
editorShell.SetDocumentCharacterSet(charset);
|
||||
}
|
||||
|
||||
editorShell.EndBatchChanges();
|
||||
|
||||
window.opener.ok = true;
|
||||
SaveWindowLocation();
|
||||
return true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче