fluid-work IRC Logs-2009-07-08

[07:58:11 EDT(-0400)] * Justin_o (n=Justin@142.150.154.171) has joined #fluid-work
[08:30:08 EDT(-0400)] * laurel (n=Laurel@142.150.154.178) has joined #fluid-work
[08:56:40 EDT(-0400)] * anastasiac (n=team@142.150.154.189) has joined #fluid-work
[09:10:02 EDT(-0400)] * heidi (n=thesumme@142.150.154.101) has joined #fluid-work
[09:27:53 EDT(-0400)] * michelled (n=team@142.150.154.193) has joined #fluid-work
[09:29:34 EDT(-0400)] * yura (n=yura@142.150.82.87) has joined #fluid-work
[09:54:36 EDT(-0400)] * athena (n=athena@adsl-75-58-122-144.dsl.wlfrct.sbcglobal.net) has joined #fluid-work
[09:55:14 EDT(-0400)] * clown (n=clown@142.150.154.202) has joined #fluid-work
[10:07:00 EDT(-0400)] * jsilvaa (n=jsilva@142.150.82.73) has joined #fluid-work
[10:11:41 EDT(-0400)] * colinclark (n=colin@70.30.89.129) has joined #fluid-work
[10:12:49 EDT(-0400)] * fj4000 (n=Jacob@142.150.154.106) has joined #fluid-work
[10:13:03 EDT(-0400)] <colinclark> fj4000: Heya
[10:13:07 EDT(-0400)] <fj4000> hiya
[10:13:27 EDT(-0400)] <colinclark> As I read it, your code works fine.
[10:13:35 EDT(-0400)] <colinclark> It's how you use your code that is broken.
[10:13:52 EDT(-0400)] <fj4000> im open to changes (smile)
[10:14:06 EDT(-0400)] <colinclark> So the third argument to add/removeEventListener is whether or not to use capturing... It's got to be the same for both invocations.
[10:14:14 EDT(-0400)] <fj4000> ok
[10:14:18 EDT(-0400)] <colinclark> So, false is probably just fine for both. I was totally wrong to suggest changing it last night.
[10:14:48 EDT(-0400)] <colinclark> So, I think this code is actually working. I think you should prove it by writing a unit test for fluid.transition(), though.
[10:15:06 EDT(-0400)] <fj4000> ok, i could do that with michelle this afternoon
[10:15:11 EDT(-0400)] <colinclark> That'd be great.
[10:15:22 EDT(-0400)] <colinclark> But the problem is in how you are using fluid.transition().
[10:15:26 EDT(-0400)] <fj4000> so how would you suggest I change my code flow?
[10:15:32 EDT(-0400)] <colinclark> So you have this options structure, and in it you've got a callback function.
[10:15:59 EDT(-0400)] <colinclark> You try to remove that callback function in case it was added before, then add it again.
[10:16:14 EDT(-0400)] <colinclark> But take a look at your code in the defaultTransitions function.
[10:16:21 EDT(-0400)] * EricDalquist (n=dalquist@bohemia.doit.wisc.edu) has joined #fluid-work
[10:16:31 EDT(-0400)] <fj4000> im there now
[10:17:09 EDT(-0400)] <colinclark> So you call that method inside viewManager.showView()
[10:17:23 EDT(-0400)] <fj4000> through the options, yes
[10:17:26 EDT(-0400)] <colinclark> Right.
[10:17:47 EDT(-0400)] <colinclark> let me just get this code up in aptana so I can give you some line numbers to look at.
[10:17:53 EDT(-0400)] <fj4000> thanks
[10:19:46 EDT(-0400)] <colinclark> Ok, so line 105 and 120 are interesting.
[10:20:06 EDT(-0400)] <colinclark> On line 105, you define a function called postTransition. On line 120, you pass this new function as a callback.
[10:20:26 EDT(-0400)] <colinclark> But remember that the scope of this postTransition function is confined to defaultTransitions()...
[10:20:46 EDT(-0400)] <colinclark> meaning you get a new callback function each time you call defaultTransitions()
[10:20:48 EDT(-0400)] <fj4000> am i creating a bad closure?
[10:20:54 EDT(-0400)] <fj4000> oh
[10:21:01 EDT(-0400)] <colinclark> I don't even know what a "bad closure" would look like. (tongue)
[10:21:06 EDT(-0400)] <fj4000> not very efficient, eh?
[10:21:10 EDT(-0400)] <colinclark> No, that's not it at all.
[10:21:16 EDT(-0400)] <colinclark> Your code isn't doing what you think it is.
[10:21:29 EDT(-0400)] <fj4000> sounds very Jedi-like
[10:21:36 EDT(-0400)] <fj4000> please continue...
[10:21:47 EDT(-0400)] <colinclark> So each time you invoke defaultTransitions(), you're expecting fluid.transition() to remove your old event listener and add the new one...
[10:22:01 EDT(-0400)] <colinclark> but you're giving it a new callback each time.
[10:22:17 EDT(-0400)] <colinclark> So how could it remove a function that hasn't already been added as a listener?
[10:22:19 EDT(-0400)] <fj4000> its not overwriting it?
[10:22:42 EDT(-0400)] <colinclark> Each time you invoke defaultTransitions(), you're creating a new callback function.
[10:22:49 EDT(-0400)] <fj4000> ohhhh
[10:22:57 EDT(-0400)] <colinclark> It has no relationship to any previous ones. Hence you can't sensible remove it that way.
[10:23:08 EDT(-0400)] <fj4000> i thought since options.callback seemed the same, it would be overwritten
[10:23:13 EDT(-0400)] <fj4000> i see
[10:23:25 EDT(-0400)] <colinclark> "Seemed the same?"
[10:23:25 EDT(-0400)] <fj4000> thanks for pointing that out
[10:23:27 EDT(-0400)] <fj4000> yes
[10:23:40 EDT(-0400)] <fj4000> i forgot that functions cant be compared
[10:24:01 EDT(-0400)] <colinclark> (smile)
[10:24:01 EDT(-0400)] <fj4000> so if I have 2 functions that have the exact same internal structure, they're still different
[10:24:10 EDT(-0400)] <colinclark> Yes, totally different.
[10:24:24 EDT(-0400)] <fj4000> i can remove this function from this scope
[10:24:43 EDT(-0400)] <colinclark> Well, this brings up a larger refactoring that I'd like to see happen here.
[10:24:47 EDT(-0400)] <colinclark> That'll have to wait until I get into the office.
[10:24:51 EDT(-0400)] <fj4000> oh, ok
[10:25:44 EDT(-0400)] <colinclark> Let's give these defaultTransitions() and defaultAnimations() functions more descriptive names and move them out into public visibility...
[10:26:01 EDT(-0400)] <colinclark> getting rid of this added indirection of options.transition and options.animation
[10:26:09 EDT(-0400)] <fj4000> ok
[10:26:27 EDT(-0400)] <colinclark> And instead, just configure these based on their names.
[10:26:56 EDT(-0400)] <colinclark> Anyway, I'll think about it a bit on the subway, and we kind find some time to work on it.
[10:27:13 EDT(-0400)] <fj4000> ok, i was just going to ask
[10:27:20 EDT(-0400)] <colinclark> Or michelled can perhaps help, too, if I get bogged down today.
[10:27:29 EDT(-0400)] <colinclark> I'll respond to the list with a link to this chat so people know.
[10:27:32 EDT(-0400)] <fj4000> either way, the help would be very nice
[10:27:35 EDT(-0400)] <colinclark> totally
[10:27:56 EDT(-0400)] <michelled> I can help out but I'm in a meeting at the moment - I'll catch up in a bit
[10:27:58 EDT(-0400)] <michelled> (smile)
[10:28:14 EDT(-0400)] <fj4000> np - we're scheduled for later anyways michelled
[10:35:57 EDT(-0400)] <colinclark> fj4000: Do you know if Safari supports the DOM 3 eventListenerList method?
[10:36:09 EDT(-0400)] <colinclark> That's what you were looking for the other day while debugging, I think.
[10:36:20 EDT(-0400)] <fj4000> i dont know - but thats for that!
[10:36:24 EDT(-0400)] <fj4000> *thanks
[10:36:37 EDT(-0400)] <fj4000> that sounds exactly like what i was looking for
[10:54:16 EDT(-0400)] <anastasiac> Bosmo1, do you have a moment for a question about fluid.fetchResources()?
[10:57:42 EDT(-0400)] * Bosmon (n=Bosmon@78-105-207-102.zone3.bethere.co.uk) has joined #fluid-work
[10:57:59 EDT(-0400)] <Bosmon> Hi
[10:58:04 EDT(-0400)] <Bosmon> Looks like I got knocked off the room...
[10:58:09 EDT(-0400)] <anastasiac> Hi, Bosmon
[10:58:14 EDT(-0400)] <anastasiac> do you have a moment?
[11:11:06 EDT(-0400)] * EricDalquist (n=dalquist@bohemia.doit.wisc.edu) has joined #fluid-work
[11:15:36 EDT(-0400)] <Bosmon> Hi there
[12:01:55 EDT(-0400)] * alisonbenjamin (n=alisonbe@142.150.154.101) has joined #fluid-work
[12:15:43 EDT(-0400)] * yura (n=yura@142.150.82.87) has joined #fluid-work
[12:47:17 EDT(-0400)] * colinclark (n=colin@142.150.154.101) has joined #fluid-work
[13:28:51 EDT(-0400)] * colinclark (n=colin@142.150.154.101) has joined #fluid-work
[14:48:10 EDT(-0400)] * yura (n=yura@142.150.82.114) has joined #fluid-work
[14:49:16 EDT(-0400)] * mackrauss (n=mackraus@142.150.154.128) has joined #fluid-work
[14:50:14 EDT(-0400)] * mackrauss (n=mackraus@142.150.154.128) has joined #fluid-work
[16:03:33 EDT(-0400)] * anastasiac (n=team@142.150.154.189) has left #fluid-work
[16:09:19 EDT(-0400)] * alisonbenjamin (n=alisonbe@142.150.154.101) has joined #fluid-work
[16:55:57 EDT(-0400)] * Justin_o (n=Justin@142.150.154.171) has left #fluid-work
[17:42:04 EDT(-0400)] * clown (n=clown@142.150.154.202) has left #fluid-work
[18:51:01 EDT(-0400)] * alisonbenjamin (n=alisonbe@dsl-207-112-95-167.tor.primus.ca) has joined #fluid-work
[20:52:05 EDT(-0400)] * heidi (n=thesumme@bas5-oshawa95-1176479318.dsl.bell.ca) has joined #fluid-work
[21:01:19 EDT(-0400)] * yura (n=yura@bas3-toronto06-1177890603.dsl.bell.ca) has joined #fluid-work
[22:23:13 EDT(-0400)] * yura (n=yura@bas3-toronto06-1177890603.dsl.bell.ca) has joined #fluid-work
[23:17:16 EDT(-0400)] * yura (n=yura@bas3-toronto06-1177890603.dsl.bell.ca) has joined #fluid-work