I'm trying to find the cleanest way to do the following:

I want to have a class that takes a div's id as the argument and then creates
another div to wrap around the first, without changing anything about the
original div.

  <div id="stuff"></div>

  new Foo('stuff')

would result in
  <div id="foo"><div id="stuff></div></div>

I'm looking at the Insertion classes, but there doesn't seem to be an
Insertion.Around, and the best thing I can come up with is to create the new
wrapper div, initially empty, then copy the target div and insert it as the
first child and then delete the target div. This seems messy and potentially
complicated if I have to eval any JS or un-register any JS handlers in the
original div. I'd like my class to know as little about the original div as
possible.

Thanks.

-- 
Michael Peters
Developer
Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to