Thanks for all your work on this! We very much appreciate patches and
bug reports, although people are sometimes too busy to respond to
email. :-(

After investigating this, I think the main problem here was introduced
in revision 1383. That change introduced the new functions
MochiKit.Style.getElementHeight and MochiKit.Style.getElementWidth and
changed MochiKit.Visual to use them in several places. There are
apparently issues with these functions and they are also lacking test
cases.

I've been discussing the design of these with Christoph Zwerschke on
the list a bit. Perhaps you could read up a bit on this so that I
don't have to repeat myself here?

Anyway. I think we should rollback most of rev 1383 to avoid these
problems. We'll then get back the issues with paddings, but that seems
less problematic. The best way forward would be to improve
getElementDimensions() in a fully backwards-compatible way to
correctly handle this.

Anybody up for the task?

Cheers,

/Per

On Tue, Jun 10, 2008 at 6:50 PM, Michael Bond <[EMAIL PROTECTED]> wrote:
>
> Here's an updated blindDown, had a syntax error that showed up in
> Firefox but not in Safari/WebKit:
>
>
> /** @id MochiKit.Visual.slideDown */
> MochiKit.Visual.slideDown = function (element, /* optional */ options)
> {
>    /***
>
>    Slide an element down.
>    It needs to have the content of the element wrapped in a container
>    element with fixed height.
>
>    ***/
>    var d = MochiKit.DOM;
>    var b = MochiKit.Base;
>    var s = MochiKit.Style;
>    element = d.getElement(element);
>    if (!element.firstChild) {
>        throw "MochiKit.Visual.slideDown must be used on a element
> with a child";
>    }
>    d.removeEmptyTextNodes(element);
>    var oldInnerBottom = s.getStyle(element.firstChild, 'bottom') ||
> 0;
>    var elemClip;
>    options = b.update({
>        scaleContent: false,
>        scaleX: false,
>        scaleFrom: 0,
>        restoreAfterFinish: true,
>        beforeSetupInternal: function (effect) {
>            elemClip = d.makeClipping(effect.element);
>            s.showElement(effect.element);
>            scaleMode = {originalHeight: s.getElementHeight(element),
>                originalWidth: s.getElementWidth(element)};
>        },
>        afterSetupInternal: function (effect) {
>            d.makePositioned(effect.element);
>            d.makePositioned(effect.element.firstChild);
>            if (/Opera/.test(navigator.userAgent)) {
>                s.setStyle(effect.element, {top: ''});
>            }
>            s.setStyle(effect.element, {height: '0px'});
>        },
>        afterUpdateInternal: function (effect) {
>            s.setStyle(effect.element.firstChild,
>               {bottom: (effect.dims[0] -
> s.getElementHeight(effect.element)) + 'px'});
>        },
>        afterFinishInternal: function (effect) {
>            d.undoClipping(effect.element, elemClip);
>            // IE will crash if child is undoPositioned first
>            if (/MSIE/.test(navigator.userAgent)) {
>                d.undoPositioned(effect.element);
>                d.undoPositioned(effect.element.firstChild);
>            } else {
>                d.undoPositioned(effect.element.firstChild);
>                d.undoPositioned(effect.element);
>            }
>            s.setStyle(effect.element.firstChild, {bottom:
> oldInnerBottom});
>        }
>    }, options);
>
>    return new MochiKit.Visual.Scale(element, 100, options);
> };
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to