[Rails-spinoffs] Re: Should Event.stopObserving() remove itself from cache?

2006-12-16 Thread Peter Michaux
On 12/15/06, Eric Harrison [EMAIL PROTECTED] wrote: But yeah, stay away from anonymous functions if there is any chance you'll ever want to remove that event observation. In the spirit of this comment it isn't it more than just anonymous function that are the problem? pseudocode function

[Rails-spinoffs] Re: Should Event.stopObserving() remove itself from cache?

2006-12-16 Thread Peter Michaux
On 12/14/06, heidmotron [EMAIL PROTECTED] wrote: maybe using the anonymous function was a bad example. my point is just the Event.observers array. it can get quite big if you have a ton of observers. let say you have a hundred elements each in a partial and each element has an observer for

[Rails-spinoffs] Re: Should Event.stopObserving() remove itself from cache?

2006-12-16 Thread RobG
Peter Michaux wrote: On 12/15/06, Eric Harrison [EMAIL PROTECTED] wrote: But yeah, stay away from anonymous functions if there is any chance you'll ever want to remove that event observation. In the spirit of this comment it isn't it more than just anonymous function that are the

[Rails-spinoffs] Re: Should Event.stopObserving() remove itself from cache?

2006-12-16 Thread RobG
Peter Michaux wrote: On 12/16/06, RobG [EMAIL PROTECTED] wrote: pseudocode function attachMyObserver() { function handler(){} attach(myDiv, 'click', handler); } /pseudocode So it isn't an anonymous function but a named inner function. Now how would i

[Rails-spinoffs] Re: Should Event.stopObserving() remove itself from cache?

2006-12-16 Thread Peter Michaux
On 12/16/06, RobG [EMAIL PROTECTED] wrote: Peter Michaux wrote: So what is the syntax to do this? pseudocode function attachMyObserver() { function handler(){} attach(myDiv, 'click', handler); } attachMyObserver(); detach('myDiv', 'click', handler);

[Rails-spinoffs] Re: this.loop.bind is not a function

2006-12-16 Thread Danijel K.
Hey, Yes the js files in the header are normally linked on all the pages with script src... Not communicating with the window opener at all. I've set it up at http://www.kafic.net/pop/test.html for a better overview of the problem. I can also confirm that this does work in ie7 but not the

[Rails-spinoffs] Re: this.loop.bind is not a function

2006-12-16 Thread Martin Bialasinski
There was a threat (or even a bug on Trac) about a bug in Firefox 2 relating to window.open(). I think this is what you see. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to

[Rails-spinoffs] Re-attaching observers after page changes

2006-12-16 Thread Michael Schuerig
Ajax request may well replace parts of a page to which observers had been attached previously. The original observers may have been attached completely explicitly or more implicitly through behavio(u)r-like constructs. It is rather unlikely that knowledge about all such observers is

[Rails-spinoffs] Re: Re-attaching observers after page changes

2006-12-16 Thread Ryan Gahl
Create widget classes that encapsulate their own Ajax needs (i.e. autonomous controls that handle their own html refreshing), and when one redraws itself, re-attaches its own behaviors as needed. Each widget can be viewed as its own mini-page. The pattern on a high level is as follows: Page

[Rails-spinoffs] Re: Re-attaching observers after page changes

2006-12-16 Thread Michael Schuerig
On Saturday 16 December 2006 18:27, Ryan Gahl wrote: Create widget classes that encapsulate their own Ajax needs (i.e. autonomous controls that handle their own html refreshing), and when one redraws itself, re-attaches its own behaviors as needed. Each widget can be viewed as its own

[Rails-spinoffs] Re: Re-attaching observers after page changes

2006-12-16 Thread Ryan Gahl
OK, just a suggestion. Sounds like you're not really working with a long lived single page app anyway. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Spinoffs group. To post to this group, send

[Rails-spinoffs] Re: Re-attaching observers after page changes

2006-12-16 Thread Michael Schuerig
On Sunday 17 December 2006 00:01, Ryan Gahl wrote: OK, just a suggestion. Sounds like you're not really working with a long lived single page app anyway. Indeed, sorry I didn't explain better what I'm doing from the start. I'm not meaning to dismiss your suggestion either. It's just that, in