[Project_owners] Persistence

Laeb (hotmail) laebcontact at hotmail.com
Sun Dec 21 15:57:52 EST 2003


Thank you for your help guys !

I finally found what was wrong in my code: the first argument of the persist method was tb.id instead of "PersonalToolbar" ...
Here is the correct code:

  tb=document.getElementById("PersonalToolbar");
  if(tb.hasAttribute("collapsed")) tb.removeAttribute("collapsed");
  else tb.setAttribute("collapsed",true);
  //make it persistent
  document.persist("PersonalToolbar", 'collapsed');

BTW, the "goToggleToolbar('PersonalToolbar','cmd_viewpersonaltoolbar');" function does not work properly if i use it instead of this code !!!

Laeb.

  ----- Original Message ----- 
  From: HJ 
  To: Mozdev Project Owners List 
  Sent: Sunday, December 21, 2003 2:39 PM
  Subject: RE: [Project_owners] Persistence


  "Laeb \(hotmail\)" <laebcontact at hotmail.com> wrote:
  >Hi,
  >
  >The code below toggles the bookmarks toolbar but the state of this toolbar
  >is not made persistent (comes back to original value at startup). Does
  >anyone knows how to make it persistent ?
  >
  >  tb=document.getElementById("PersonalToolbar");
  >
  >  if(tb.hasAttribute("collapsed")) {
  >   tb.removeAttribute("collapsed");
  >   }
  >  else {
  >   tb.setAttribute("collapsed",true);
  >  }
  >   document.persist(tb.id, 'collasped');
  >
  >Thank you.
  >Laeb.

  You should use -> goToggleToolbar('PersonalToolbar','cmd_viewpersonaltoolbar');

  (see also: http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/utilityOverlay.js#158)

  because it makes use of an 'observer'

  (see also: http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/navigatorOverlay.xul#189)

  /HJ

  __________________________________________________________________
  New! Unlimited Access from the Netscape Internet Service.
  Beta test the new Netscape Internet Service for only $1.00 per month until 3/1/04.
  Sign up today at http://isp.netscape.com/register
  Act now to get a personalized email address!

  Netscape. Just the Net You Need.
  _______________________________________________
  Project_owners mailing list
  Project_owners at mozdev.org
  http://mozdev.org/mailman/listinfo/project_owners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20031221/6288e2d5/attachment.htm


More information about the Project_owners mailing list