[Proto-Scripty] Re: PrototypeJS + Chrome + Observers

2008-10-22 Thread Jeztah



On Oct 7, 4:41 pm, kangax [EMAIL PROTECTED] wrote:
 On Oct 7, 3:21 am, Roland [EMAIL PROTECTED] wrote:



  Hi there,

  I have this little function within my class:

  var _setObservers = function(events, func, handle){
          if(!events) return;
          events = _getObservers(events);
          if(events.size()  1) return;
          func   = func.bindAsEventListener(this);
          handle = handle || this._handlers;
          events.each(function(event){
                  alert(event); //- fired!
                  if(Object.isArray(handle)) handle.invoke('observe', event, 
  func);
                  else $(handle).observe(event, func);
          });

  }.bind(this);

  Firefox + IE shows no problems, Google Chrome however doesnt fire the
  observers BUT fires the alert...

  Whats wrong with chrome.. except its beta ;]

 Could you this example to a minimal failing one?
 Does `_getObservers` transform string into an array?
 Does plain `handle.observe(eventName, handler)` work?



  Roland

 --
 kangax

I also have a similar problem


The function

$$('.foo').invoke('observe', 'click', function(event) {
alert('Ive Been Clicked');


});

div class=fooClick me /div
div class=fooAnd me /div
div class=fooAnd me /div
div class=fooAnd me /div


Does not attach to all the elements with class=foo in the
document .. it only attaches to the first one 

It works fine in
FF2
FF3
IE7
Safari 3x (windows)
FF3 Linux
Opera 9x (windows)

I cant decipher what the problem is or where it lies

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: PrototypeJS + Chrome + Observers

2008-10-07 Thread kangax

On Oct 7, 3:21 am, Roland [EMAIL PROTECTED] wrote:
 Hi there,

 I have this little function within my class:

 var _setObservers = function(events, func, handle){
         if(!events) return;
         events = _getObservers(events);
         if(events.size()  1) return;
         func   = func.bindAsEventListener(this);
         handle = handle || this._handlers;
         events.each(function(event){
                 alert(event); //- fired!
                 if(Object.isArray(handle)) handle.invoke('observe', event, 
 func);
                 else $(handle).observe(event, func);
         });

 }.bind(this);

 Firefox + IE shows no problems, Google Chrome however doesnt fire the
 observers BUT fires the alert...

 Whats wrong with chrome.. except its beta ;]

Could you this example to a minimal failing one?
Does `_getObservers` transform string into an array?
Does plain `handle.observe(eventName, handler)` work?


 Roland

--
kangax
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---