Does anyone have any sample code of how to make a box capable of utilizing a minimize/maximize/close feature? I''d like to add this functionality to a set of "blocks" on the web page. (similar to a block like the one at http://php-syslog-ng.gdd.net) Thanks! -Clayton Dukes --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Nicolás Sanguinetti
2007-Sep-14 05:54 UTC
Re: Minimize/Maximize/Close for individual blocks
With an html like <div.window> <div.titlebar> ... <a.toggle>min</a> </div> <div.contents> ... </div> </div> You can do something like $$(".window .toggle").invoke("observe", "click", function(event) { var contents = this.up(".window").down(".contents").toggle(); this.update(contents.visible() ? "min" : "max"); event.stop(); // change to Event.stop(event) if you are using Prototype 1.5.x }); Which would show/hide the contents and change the minimize button to a maximize and vice versa. A similar function can be made to close the windows (calling this.up (".window").remove()). Did you mean something like that? Best, -Nicolas On 9/13/07, Clayton Dukes <cdukes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Does anyone have any sample code of how to make a box capable of utilizing > a minimize/maximize/close feature? > I''d like to add this functionality to a set of "blocks" on the web page. > (similar to a block like the one at http://php-syslog-ng.gdd.net) > > > > Thanks! > -Clayton Dukes > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''m not sure since I''ve not done it before. Thanks, I''ll give this a shot :-) On 9/14/07, Nicolás Sanguinetti <godfoca-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > With an html like > > <div.window> > <div.titlebar> ... <a.toggle>min</a> </div> > <div.contents> ... </div> > </div> > > You can do something like > > $$(".window .toggle").invoke("observe", "click", function(event) { > var contents = this.up(".window").down(".contents").toggle(); > this.update(contents.visible() ? "min" : "max"); > event.stop(); // change to Event.stop(event) if you are using Prototype > 1.5.x > }); > > Which would show/hide the contents and change the minimize button to a > maximize and vice versa. > A similar function can be made to close the windows (calling this.up > (".window").remove()). > > Did you mean something like that? > > Best, > -Nicolas > > On 9/13/07, Clayton Dukes <cdukes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Does anyone have any sample code of how to make a box capable of > > utilizing a minimize/maximize/close feature? > > I''d like to add this functionality to a set of "blocks" on the web > > page. (similar to a block like the one at http://php-syslog-ng.gdd.net) > > > > > > > > Thanks! > > -Clayton Dukes > > > > > > > > > > > >-- ______________________________________________________________ Clayton Dukes ______________________________________________________________ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---