Bug 361694: Altering a tag's importance resets its name and colour; r/sr=neil

This commit is contained in:
mnyromyr%tprac.de 2006-11-25 13:06:02 +00:00
Родитель 1c5ea939ad
Коммит d246a38be2
1 изменённых файлов: 10 добавлений и 4 удалений

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

@ -82,10 +82,8 @@ function GetFields(aPageData)
if (entry.localName == 'listitem')
{
// update taginfo with current values from textbox and colorpicker
var taginfo = entry.taginfo;
taginfo.tag = entry.firstChild.firstChild.value;
taginfo.color = entry.lastChild.lastChild.color;
tags.push(taginfo);
UpdateTagInfo(entry.taginfo, entry);
tags.push(entry.taginfo);
}
aPageData[ACTIVE_TAGS_ID] = tags;
@ -131,6 +129,13 @@ function SetFields(aPageData)
gDeletedTags = (DELETED_TAGS_ID in aPageData) ? aPageData[DELETED_TAGS_ID] : {};
}
// read text and color from the listitem
function UpdateTagInfo(aTagInfo, aEntry)
{
aTagInfo.tag = aEntry.firstChild.firstChild.value;
aTagInfo.color = aEntry.lastChild.lastChild.color;
}
// set text and color of the listitem
function UpdateTagEntry(aTagInfo, aEntry)
{
@ -251,6 +256,7 @@ function MoveTag(aMoveUp)
// This reordering may require changing ordinal strings, which will happen
// when we write tag data to the preferences system in the OKHandler.
var entry = gTagList.selectedItem;
UpdateTagInfo(entry.taginfo, entry); // remember changed values
var successor = aMoveUp ? gTagList.getPreviousItem(entry, 1)
: gTagList.getNextItem(entry, 2);
entry.parentNode.insertBefore(entry, successor);