#470 ✓invalid
Marco Del Percio

Modalbox IE6 setStyle Object required

Reported by Marco Del Percio | November 28th, 2008 @ 02:17 PM

Don't know if it's a Modalbox or Prototype issue, anyway I'm posting on both. As you probably know Modalbox is based on top of Prototype and Scriptaculous; when you call Modalbox.show() or Modalbox.hide() it uses Prototype's setStyle to change style of any element in order to make appear/disappear modal window on top and set transparency on elements. With IE6 if you call Modalbox.show() any item in the page disappears and then calling Modalbox.hide() gets an uncaught exception of type "Object required" in Prototype's setStyle method and then it doesn't let you to call Modalbox.show() again (if you call again Modalbox.show() the box get closed suddenly reporting an error). I suppose Modalbox is calling setStyle in a bad way on items getting this strange result.

Issue can be reproduced on a Win XP SP2 machine with IE6 SP1, Modalbox 1.6.0, Prototype 1.6.0.3 and Scriptaculous 1.8.2

Comments and changes to this ticket

  • Marco Del Percio

    Marco Del Percio November 28th, 2008 @ 02:50 PM

    I found very trivial workaround in order to keep Modalbox working :) Change setStyle method inside prototype.js like this:

    setStyle: function(element, styles) {

    element = $(element);
    try {
            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') ?
                  (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
                    property] = styles[property];
              }
            }
                    return element;
    }
    catch(e) {
        return element;
    }
    
    

    },

  • Tobie Langel

    Tobie Langel November 28th, 2008 @ 03:53 PM

    • State changed from “new” to “invalid”

    That's clearly a ModalBox issue. Closing as invalid.

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 02:34 AM

    • Tag changed from ie6, modalbox, prototype, setstyle to ie6

    [not-tagged:"prototype" bulk edit command]

  • Tobie Langel

    Tobie Langel July 24th, 2009 @ 12:46 PM

    • Tag cleared.

    [not-tagged:"ie6" not-tagged:"ie7" bulk edit command]

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 ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages