From 4562c8656f383948aabd6cc789fc76e40d7f611e Mon Sep 17 00:00:00 2001 From: "chanial%noos.fr" Date: Thu, 11 Dec 2003 14:23:02 +0000 Subject: [PATCH] fix the no more persisted "class" attribute in old profiles. the expandable state may be persisted in the future. --- .../components/bookmarks/content/addBookmark2.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/browser/components/bookmarks/content/addBookmark2.js b/browser/components/bookmarks/content/addBookmark2.js index 8b7290964052..9c92fde1c776 100644 --- a/browser/components/bookmarks/content/addBookmark2.js +++ b/browser/components/bookmarks/content/addBookmark2.js @@ -91,6 +91,20 @@ function Startup() gName.focus(); onFieldInput(); gSelectedFolder = RDF.GetResource(gMenulist.selectedItem.id); + + // fix no more persisted class attribute in old profiles + var localStore = RDF.GetDataSource("rdf:local-store"); + var rAttribute = RDF.GetResource("class"); + var rElement = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul#expander"); + var rDialog = RDF.GetResource("chrome://browser/content/bookmarks/addBookmark2.xul"); + var rPersist = RDF.GetResource(NC_NS+"persist"); + + var rOldValue = localStore.GetTarget(rElement, rAttribute, true); + if (rOldValue) { + localStore.Unassert(rElement, rAttribute, rOldValue, true); + localStore.Unassert(rDialog, rPersist, rElement, true); + document.getElementById("expander").setAttribute("class", "down"); + } } function onFieldInput()