зеркало из https://github.com/mozilla/pjs.git
Bug 361694: Altering a tag's importance resets its name and colour; r/sr=neil
This commit is contained in:
Родитель
1c5ea939ad
Коммит
d246a38be2
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче