[Prototype-core] Re: Event.observe and .stopObserving

2007-04-22 Thread Радослав Станков
I use this a time ago for events, but I haven't time to test it. Element.addMethods( { on: function (element, event, func) { var prop = ['event' + event]; if (!element[prop]) element[prop] = []; element[prop].push(func);

[Prototype-core] Re: what about an "ready" function?

2007-04-23 Thread Радослав Станков
I use this add-on to prototype(http://www.danwebb.net/2007/4/16/low- pro-0-4-released) It have Event.onReady() function --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group,

[Prototype-core] Re: Integration of something like ben nolan's behaviour?

2007-05-04 Thread Радослав Станков
I use this for events assignment (with little extension of mine): http://alternateidea.com/blog/articles/2006/3/21/introducing-css-event-selectors --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" gr

[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread Радослав Станков
this sounds like: $('some_element_id').appendChild( new Element(tagName, options) ); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@goo

[Prototype-core] Re: Element.build and element.build

2007-06-01 Thread Радослав Станков
My be such wrapper around "new Element()" will be useful, but Ask your self when you insert nodes where do you insert them, or how (with appendChild, insertBefore, insertAfter, ), an when inserting item do you just create it, or add events or do other things except that ? mainly I do some thin

[Prototype-core] Re: $ function

2007-06-18 Thread Радослав Станков
I really think that name and id should be different no to overload $() with more functionality. Besides it is easy to catch such error if there are names equal to ids even in complicated JS scripts. here http://video.yahoo.com/video/play?vid=410472 near 10 minute to see more problems with IE and

[Prototype-core] Re: $ function

2007-06-18 Thread Радослав Станков
Vote for #1 I think we as developers should think about the performance and code, and we should be aware of this " traps ". But to make fix which will be helpful for unaware people and lower the quality, I don't think It is a good idea. --~--~-~--~~~---~--~~ Yo

[Prototype-core] Re: Event.observe will destroy the scope of Javascript OOP?

2007-07-14 Thread Радослав Станков
function Cat(){ this.color = "yellow"; } Cat.prototype.showColor = function(){ alert(this.color) } Cat.prototype.init(){ Event.observe("button", "click", this.showColor.bind(this)); } Will work just fine :) the problem is that when you assign action to a button the scope of the fun

[Prototype-core] Multi event assignment

2007-08-16 Thread Радослав Станков
For a widget of mine I needed to a group of li elements to assign a multiple events (note this is just part of the code so 'this' reference to the widget: revision 1: var li = $$('#main li.views'); li.each(function(el) { el.observe('mousedown', this.onpress.bind(th

[Prototype-core] Re: iterable/$A

2007-09-03 Thread Радослав Станков
I didn't understand why don't use Array.prototype.slice from here http://www.danwebb.net/2006/11/7/a-low-down-dirty-goblin-of-a-hack ? It was working well when I tested with my app ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Prototype-core] Re: Event delegation / registration ideas

2009-01-04 Thread Радослав Станков
I'm using event delegation a lot recently. I even opened a ticket for it - http://prototype.lighthouseapp.com/projects/8886/tickets/435-eventdelegate-and-elementmethodsdelegate The problem I see in your approach, is that Event.stopObserving won't clear callback from cache, but if your Event.regi