JSB

1 view
Skip to first unread message

Marijn Huizendveld

unread,
Nov 2, 2009, 8:29:08 PM11/2/09
to base...@googlegroups.com
Hi everybody, long time no see :-$

I finally had the chance to use JSB in a project, I must say it's
really the finishing touch on top of base2 to finally use it more
often in my projects. I was wondering why elements returned by the
selector API aren't bound automatically like in the base2.DOM package.
This week I'll be playing around with animations though from what I
know this far I'd really love to see a callback implemented for when
the animation has finished. Should I post a ticket for that on google
code?

Kindest regards,

Marijn

Dean Edwards

unread,
Nov 18, 2009, 2:01:40 PM11/18/09
to base...@googlegroups.com
On 03/11/2009 01:29, Marijn Huizendveld wrote:
> I finally had the chance to use JSB in a project, I must say it's
> really the finishing touch on top of base2 to finally use it more
> often in my projects. I was wondering why elements returned by the
> selector API aren't bound automatically like in the base2.DOM package.

You can easily bind elements yourself in the onattach event:

var mybehavior = jsb.behavior.extend({
onattach: function(element) {
base2.dom.bind(element);
}
});

If you extend mybehavior to create your own behaviors then all attached
elements will be bound.

I decided not to automatically bind elements. Binding takes up valuable
processing time. JSB scales to very large DOMs. It would not scale if
every element was also bound.

> This week I'll be playing around with animations though from what I
> know this far I'd really love to see a callback implemented for when
> the animation has finished.

There is a transitionend event. This fires for every property that is
animated. I will add an another event to signify the end of the
animation itself (an animation is effectively a set of transitions).

> Should I post a ticket for that on google code?
>

Please do.

-dean

Marijn Huizendveld

unread,
Nov 18, 2009, 2:07:16 PM11/18/09
to base...@googlegroups.com

On Nov 18, 2009, at 8:01 PM, Dean Edwards wrote:

>
> On 03/11/2009 01:29, Marijn Huizendveld wrote:
>> I finally had the chance to use JSB in a project, I must say it's
>> really the finishing touch on top of base2 to finally use it more
>> often in my projects. I was wondering why elements returned by the
>> selector API aren't bound automatically like in the base2.DOM
>> package.
>
> You can easily bind elements yourself in the onattach event:
>
> var mybehavior = jsb.behavior.extend({
> onattach: function(element) {
> base2.dom.bind(element);
> }
> });

That's what I did for now...

> If you extend mybehavior to create your own behaviors then all
> attached
> elements will be bound.
>
> I decided not to automatically bind elements. Binding takes up
> valuable
> processing time. JSB scales to very large DOMs. It would not scale if
> every element was also bound.

That's what I thought, after thinking about it the current
implementation is fine. It's just that I wasn't expecting it. Perhaps
we should add it to the docs..

>> This week I'll be playing around with animations though from what I
>> know this far I'd really love to see a callback implemented for when
>> the animation has finished.
>
> There is a transitionend event. This fires for every property that is
> animated. I will add an another event to signify the end of the
> animation itself (an animation is effectively a set of transitions).

Great! I'm kinda busy at the moment but I'll have a look at it later on.

>> Should I post a ticket for that on google code?

So I'll post a ticket later on this week.

> Please do.
>
> -dean
>
> >

Reply all
Reply to author
Forward
0 new messages