#90 ✓resolved
MadRabbit

Fx.Morph better css properties support

Reported by MadRabbit | October 21st, 2009 @ 11:51 PM | in 1.5.0 Release

joeally @rightjs animating short hand. For example being able to animate 'margin' to "1px 3px 5px 6px" and being able to animate background position

probably would be cool to have some sort of generic properties processor that work though the list automatically without a predefined list of supported options

Comments and changes to this ticket

  • Joe Ally

    Joe Ally October 22nd, 2009 @ 11:49 PM

    (http://paste2.org/p/479962)[http://paste2.org/p/479962]. This is a quick fix and supports all properties that have shorthand capabilities but I didn't write a generic processor. Instead I noticed that your fx.morph module applies the styles to a dummy element(which is pretty neat). So I just set the individual properties to animate. For example if someone wanted to animate 'margin' to "1px 3px 5px 6px" I added instructions that tell the animator to animate each margin individually and since it gets the end styles from a dummy element this can be done very easily. For background position I just added a special case. Tommorow next week I might have a look at writting a generic proccessor

  • Joe Ally

    Joe Ally October 23rd, 2009 @ 12:01 AM

    Note: with my fix you must set background position in css first

  • MadRabbit

    MadRabbit October 23rd, 2009 @ 12:13 AM

    I think it will work faster if it will check the margin/padding value and if there are four units then use separated margins for each of them. and then it would be good to speed up the things a bit by using a single for() loop instead of several fancy calls, plus use string slices instead of regular expressions, plus would bee good to compact the things a bit by removing duplications. And then your code seems like don't remote the original property, there was a splice call I believe for that reason.

  • MadRabbit

    MadRabbit October 23rd, 2009 @ 12:21 AM

    but don't worry about it. I'm going to rework/reorganize the Fx.Morph code anyway, to get rid of most of the patches and exceptions, so there is no reason to wrap it with another one now

  • Joe Ally

    Joe Ally October 28th, 2009 @ 05:07 PM

    i have made another one that supports generic properties. Accept that it's not working for properties like border-top-color yet (I don't know why). But I think this is more of what you are looking for

  • Joe Ally

    Joe Ally October 28th, 2009 @ 05:44 PM

    Oh I didn't read the earlier comment...I wasted my time here :(

  • MadRabbit

    MadRabbit October 28th, 2009 @ 05:53 PM

    Not at all, I see where you're going with that and probably will cherry-pick some stuff later.

    And then I had completely missed the background-position feature, so I appreciate your help anyway

  • MadRabbit

    MadRabbit December 1st, 2009 @ 11:36 PM

    • State changed from “new” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

RightJS Core Tickets

Shared Ticket Bins

People watching this ticket

Pages