1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    rrraven is on a distinguished road

      0  

    Default something wrong with animation code

    something wrong with animation code


    take, for example, blindShow function

    blindShow=function(anchor,newSize,duration,easing){var size=newSize||this.getSize();this.clip();this.setVisible(true);anchor=anchor.toLowerCase();switch(anchor){case't':case'top':this.setHeight(1);this.setHeight(newSize,true,duration||.5,null,easing||YAHOO.util.Easing.easeOut);break;case'l':case'left':this.setWidth(1);this.setWidth(newSize,true,duration||.5,null,easing||YAHOO.util.Easing.easeOut);break;}
    this.unclip();return size;};

    First of all, getSize() results are discarded so it doesn't work if newSize isn't specified (that's what led me to the investigation)
    Then, if we add alert(this.getSize) to the func bidy we find out that this.getSize is actually a completely irrelevant, it's a func that returns some flavour of screen size and requires a parameter
    And then I guess it could use beginMeasure and endMeasure given that the element size of which is required is hiddent when we launch getSize

  2. #2
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    rrraven is on a distinguished road

      0  

    Default


    Err, I did a bit of digging, getSize ma be not as irrelevant as it seemed but I dunno what sdhould be passed to it and it's not "this".
    Sorry no time to dig more

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    4
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    It's worked for me before. Maybe a description of what the problem actually is, or some sample calling code would help demonstrate what you're seeing.

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    rrraven is on a distinguished road

      0  

    Default


    headerClick: function(headerId)
    {
    if (this.panels[headerId])
    {
    var panel = this.panels[headerId];
    var actor = new YAHOO.ext.Actor(panel.id, null, true);
    if (panel.isVisible())
    {
    actor.slideHide("t");
    }
    else
    {
    actor.slideShow("t");
    }

    actor.play();

    //stuff
    }
    },

    On the first run the function successfully hides the panel; on the second however the panel is only resized to one pixel high (or maybe it's some side effect and it's not resized at all).
    I injected alerts in YUI ext code and they fire so it's that function that is executed and it's clear from its code that size variable is set and never used; newSize is used and I sure do not pass it explicitly, it was probably your case (you passed newSize in?)
    Moreover, if you alert this.getSize that should set for default size value it is not correct which is also understandable if you find the func in the code and inject some debugging alerts or logging into it.
    It returns (and logs) correct values when YUI ext Layout uses it but in blindShow is returns the height of one for my case.

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    4
    Vote Rating
    0
    rrraven is on a distinguished road

      0  

    Default


    Umm... so what's up?
    Is there any way to submit biugs or are they picked up riught from here?
    Or what is wrong w/ my code

  6. #6
    Sencha User
    Join Date
    Apr 2012
    Location
    Austin, Texas
    Posts
    4
    Vote Rating
    0
    brian.moeskau is an unknown quantity at this point

      0  

    Default


    I can tell you that in the .33 codebase, there were some problems related to element size not being persisted correctly across multiple animations in some cases, and so I'm pretty sure that what you are seeing is a bug.

    The animation code has been completely refactored in 1.0, and in fact, Actor has been deprecated in favor of the new Ext.fx class. The new effects take chaining and sequencing into account correctly, including caching and auto-resetting element properties like size, opacity, etc., and should allow you to do what you're trying without any problems.

    One thing to note: the methods are now slideIn and slideOut, and the API has changed to support 8-way anchoring and an optional animation cofig object. Unfortunately, this stuff is not yet documented, but will be before final release. Hope you can wait -- trying to patch .33 at this point for this particular bug is not likely to happen.

Similar Threads

  1. Animation Direction
    By jon.whitcraft in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 6 Mar 2007, 12:06 PM
  2. Animation/Fx
    By brant in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 19 Feb 2007, 8:27 PM
  3. What went wrong in this layout?
    By saasira in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 7 Dec 2006, 4:54 AM
  4. What's wrong with this layout?
    By donalconlon in forum Community Discussion
    Replies: 7
    Last Post: 26 Nov 2006, 6:04 PM

Thread Participants: 1