Hi Guys

I'm trying to use Effect.Scale to adjust the width of an element (I have an
absolutely positioned panel I want to slide out on mouse-over).
I'm finding setSyle crashes in IE[7] on the highlighted line.

  setStyle: function(element, styles) {
    element = $(element);
    var elementStyle = element.style, match;
    if (Object.isString(styles)) {
      element.style.cssText += ';' + styles;
      return styles.include('opacity') ?
        element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) :
element;
    }
    for (var property in styles)
      if (property == 'opacity') element.setOpacity(styles[property]);
      else
        elementStyle[(property == 'float' || property == 'cssFloat') ?
          (elementStyle.styleFloat === undefined ? 'cssFloat' :
'styleFloat') :
            property] = styles[property];

    return element;
  },


My code is below:

  $('notepanel').observe('mouseover',function(e){
        if(!this.timer)
        {
            this.timer = window.setTimeout(function(){
                this.timer = undefined;
                this.hide();
                new Effect.Appear(this, { duration:.5 });
                new Effect.Scale(this, { scaleX:true, scaleY:false,
scaleContent:false, scaleMode: { originalHeight:500, originalWidth:500 }});
                this.addClassName("open");
            }.bind(this),500);
        }
    }).observe('mouseout',function(e) {
        if(this.timer)
        {
            window.clearTimeout(this.timer);
            this.timer = undefined;
        }
        if(this.hasClassName("open"))
        {
            this.removeClassName("open");
            //todo: close panel
        }
    });


I checked trac and there's a changeset, #6215
http://dev.rubyonrails.org/changeset/6215
Which seems to detail completely different code for setStyle when the
browser is IE.

I'm guessing this hasn't made it into the release version as it hasn't
completed testing or whatever yet.
Should I apply the changeset as a patch and see what happens?

Gareth

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to