[ 3 posts ]

Jiraaya

  • Joined: Fri Aug 28, 2009 6:49 am
  • Posts: 13
  • Offline
  • Profile

Help with the bubbling library

Post Posted: Fri Aug 28, 2009 7:05 am
+0-
Hi,
using the bubbling library, you can caputre events at a high level.

Consider the case

window.A = function ()
{
this.b = new window.B();
}

window.B = function()
{

}

var k = new A();

now if A subscribes to a behaviour before the instantiation of b, the instance of A gets notified first. Is there any way to modify it apart from changing the order in which the events are subscribed?

Caridy Patino

YUI Contributor

  • Username: caridy
  • Joined: Mon Dec 08, 2008 5:40 pm
  • Posts: 493
  • Location: Miami, FL
  • Twitter: caridy
  • GitHub: caridy
  • Gists: caridy
  • IRC: caridy
  • YUI Developer
  • Offline
  • Profile

Re: Help with the bubbling library

Post Posted: Fri Aug 28, 2009 9:38 am
+0-
Hello Jiraaya,

Bubbling uses YUI Custom Event for each layer (even name), and you can not change the order.

So, my question is: Why do you need to change the order? Can you explain your use-case, probably we can help you to re-design it.

Best Regards,
Caridy

Jiraaya

  • Joined: Fri Aug 28, 2009 6:49 am
  • Posts: 13
  • Offline
  • Profile
Tags:

Re: Help with the bubbling library

Post Posted: Sat Aug 29, 2009 3:14 am
+0-
Hi Caridy,
Im just playing with your library. I found in your blog at this link http://www.yuiblog.com/blog/2007/09/13/ ... by-caridy/ some comment about the order of execution that you mentioned as a disadvantage in your pattern. Im aware that it would be a bad practise to change the order in which something is done. Was just curious.
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum