[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-09 Thread Lea Hayes
I have just reported this as a potential bug at the Lighthouse website. 2008/10/10 Lea Hayes <[EMAIL PROTECTED]>: > Hi again, > > Unless I am missing something, it would appear that stopObserving does > not work at all in Google Chrome! > > 2008/10/5 Lea Hayes <[EMAIL PROTECTED]>: >> Yes, that s

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-09 Thread Lea Hayes
Hi again, Unless I am missing something, it would appear that stopObserving does not work at all in Google Chrome! 2008/10/5 Lea Hayes <[EMAIL PROTECTED]>: > Yes, that solves the problem, it now works in IE7/8+FF3. > > Sadly in Chrome it doesn't appear to work at all. Clicking the stop > button

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-06 Thread Lea Hayes
This works great, until a form or input element, is within the element hierarchy. It is mainly a problem with the HTML input tag, because most of the time (especially in ASP.NET) everything is contained within the form. Test Page Object.extend(Element.

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-05 Thread Lea Hayes
Yes, that solves the problem, it now works in IE7/8+FF3. Sadly in Chrome it doesn't appear to work at all. Clicking the stop button does absolutely nothing, yet the method is being called because I tried sticking a test message box in there. The box appears, but the events are simply not stopped.

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-05 Thread labs2.0
Woops! isVisible: function(element) { var ok = $(element).visible(); if (!ok) { return false; } $(element).ancestors().each( function(obj){ ok = obj.visible(); if (!ok) throw $break; }

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-05 Thread labs2.0
Still not like what it does to the Event.cache. If you plan an app that should work 8 hours a day, without browser refresh - hey, we are moving on to the browser or what ;) - I think that every bit should be considered, and in an interface with 3 or 4 active windows at time, each one with dozens o

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-04 Thread kangax
On Oct 3, 7:26 pm, "Lea Hayes" <[EMAIL PROTECTED]> wrote: > This works great, until a form or input element, is within the element > hierarchy. It is mainly a problem with the HTML input tag, because > most of the time (especially in ASP.NET) everything is contained > within the form. > > > >

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-03 Thread kangax
On Oct 3, 7:31 am, "Lea Hayes" <[EMAIL PROTECTED]> wrote: > Hi, > > Ah right, that's fair enough. When I wrote that post I didn't realize > that you could simply pass a function reference into the each method. > > Personally I prefer to take advantage of the slightly higher level > interfaces prov

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-03 Thread Lea Hayes
Hi, Ah right, that's fair enough. When I wrote that post I didn't realize that you could simply pass a function reference into the each method. Personally I prefer to take advantage of the slightly higher level interfaces provided by Prototype to avoid possible difficulties in future releases.

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread kangax
On Oct 2, 6:15 pm, "Lea Hayes" <[EMAIL PROTECTED]> wrote: > Or as puckpuck suggested with the 'descendants' method instead of the > CSS selector for greatly improved performance. `Element.descendants` uses `Element.select` internally. That's why I used `select` directly (to avoid an extra functio

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread Lea Hayes
I just realised, it might be better to do the following instead: Object.extend(Element.Methods, { stopObservingNested: function(element) { element.stopObserving(); element.descendants().each(Element.stop

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread Lea Hayes
Or as puckpuck suggested with the 'descendants' method instead of the CSS selector for greatly improved performance. Object.extend(Element.prototype, { stopObservingNested: function() { this.stopObserving();

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread kangax
On Oct 2, 9:57 am, labs <[EMAIL PROTECTED]> wrote: > Yeah, but if you firebug the Event object after recursive unregister, you > will see that every element that doesnt had a  _prototypeEventID will create > an entry in Event.cache. This is because the way the eventId is generated > and THERE I'll

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread labs
Yeah, but if you firebug the Event object after recursive unregister, you will see that every element that doesnt had a _prototypeEventID will create an entry in Event.cache. This is because the way the eventId is generated and THERE I'll not mess with :) Those entry are empty, I know, but ohhh..

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread puckpuck
When I made that post, I was very groggy, and realized I used a CSS selector *, which well... is horrid slow, especially on IE. using elem.descendants() instead would of made far more sense. Also I would stay away from checking on the existing of _prototypeEventID on the element. This is an int

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread Lea Hayes
Hi puckpuck!, That's a really handy little snippet, so much simpler than manually enumerating nested HTML elements and stopping them individually (which I have previously done). If this functionality were to be bundled within the Prototype framework I personally think it would be better to offer

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread labs
Yeah. I know. I did that: Element.addMethods({ clearEvents: function(element) { element.descendants().each( function(obj){ if (obj._prototypeEventID) { obj.stopObserving(); } } ); element.stopOb

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-02 Thread puckpuck
This exact question was asked today at TAE. At this time, no. stopObserving will not go through the children of the container and remove events. In the future it is certainly possible. Mind you it wouldn't be very difficult to write your own method to recurse through all the children of a give

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-10-01 Thread labs2.0
Hi. Please, would you be kind to clearify this to me: if I call "Event.stopObserving(myWindow)", beeing 'myWindow' a div (ajax generated window wich can came and go as the user will), who doesnt have observers, but its a container (and parent) for many other elements (components) that may does, m

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-09-11 Thread Kruncher
Hi guys! Thanks everyone for clarifying this for me! On Sep 10, 1:45 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > Hi again folks, > > It was already there, ticket #158 from June > 10th:http://prototype.lighthouseapp.com/projects/8886/tickets/158 > > More on the new event stuff in > 1.6.0:h

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-09-10 Thread T.J. Crowder
Hi again folks, It was already there, ticket #158 from June 10th: http://prototype.lighthouseapp.com/projects/8886/tickets/158 More on the new event stuff in 1.6.0: http://prototypejs.org/2007/8/15/prototype-1-6-0-release-candidate HTH, -- T.J. Crowder tj / crowder software / com On Sep 10, 1:

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-09-10 Thread T.J. Crowder
Hi folks, > try a look at the API > documentation:http://www.prototypejs.org/api/event/stopObserving > (you exactly do what is wrong !!) Actually, David, what she's doing is just fine. She's using a new(ish) feature of stopObserving which appears to be missing from the docs. If you don't incl

[Proto-Scripty] Re: Question regarding Element.observe and Element.stopObserving

2008-09-10 Thread david
Hi Lea, try a look at the API documentation: http://www.prototypejs.org/api/event/stopObserving (you exactly do what is wrong !!) Because you should do: myTestClass.myCallback=this.clickHandler.bindAsEventListener(this); myTestClass.prototype.initEvents = function() { var myDiv1 = $('examp