Changing a list's bullet was not applying to list items having a specific bullet assigned. b=158820, r=brade, sr=kin, a=asa

This commit is contained in:
glazman%netscape.com 2002-07-30 08:19:08 +00:00
Родитель 33670c6d07
Коммит f219a09ca9
1 изменённых файлов: 21 добавлений и 8 удалений

Просмотреть файл

@ -255,6 +255,14 @@ function SelectBulletStyle()
}
}
function ChangeListType(type, changeAll)
{
if (type && changeAll)
globalElement.setAttribute("type",type);
else
globalElement.removeAttribute("type");
}
function ValidateData()
{
var type = 0;
@ -278,10 +286,7 @@ function ValidateData()
break;
}
BulletStyleType = type;
if (type && gDialog.ChangeAllRadio.selected)
globalElement.setAttribute("type",type);
else
globalElement.removeAttribute("type");
ChangeListType(type, gDialog.ChangeAllRadio.selected);
}
else if (ListType == "ol")
@ -306,10 +311,7 @@ function ValidateData()
break;
}
BulletStyleType = type;
if (type && gDialog.ChangeAllRadio.selected)
globalElement.setAttribute("type",type);
else
globalElement.removeAttribute("type");
ChangeListType(type, gDialog.ChangeAllRadio.selected);
var startingNumber = TrimString(gDialog.StartingNumberInput.value);
if (startingNumber)
@ -343,6 +345,17 @@ function onAccept()
if (changeList)
{
if (ListElement && gDialog.ChangeAllRadio.selected && BulletStyleType != originalBulletStyleType) {
var child = ListElement.firstChild;
while (child) {
if (child.nodeType == Node.ELEMENT_NODE &&
child.nodeName.toLowerCase() == "li") {
editorShell.editor.removeAttributeOrEquivalent(child, "type");
}
child = child.nextSibling;
}
}
editorShell.MakeOrChangeList(ListType, gDialog.ChangeAllRadio.selected,
(BulletStyleType != originalBulletStyleType) ? BulletStyleType : null);