I have just upgraded to the lastest version. With Firefox I have no problems, but IE8 gives me following error report:

Message: Object doesn't support this property or method
Line: 605
Char: 7
Code: 0
URI: http://localhost/drupal/sites/all/modules/modalframe/js/parent.js?n

Comments

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

Could you please disable javascript compression and report back the line number where this error occurs?

tomsm’s picture

Where do I disable this compression? Do you mean at the Drupal Performance tab?

The error is the same with everything turned off:

Message: Object doesn't support this property or method
Line: 605
Char: 7
Code: 0
URI: http://localhost/drupal/sites/all/modules/modalframe/js/parent.js?f

markus_petrux’s picture

Status: Postponed (maintainer needs more info) » Active

hmm... yes, I meant that, however, now I just figured it is not necessary. For some reason, I was confused. Sorry. :(

Well, I need to test this under IE8, which I do not have at hand, until next Thursday.

This issue confuses me a little because the line in conflict should only be executed for IE6.

Drupal.modalFrame.fixPosition = function($element, isOpen) {
  var $window = $(window);
  if ($.browser.msie && parseInt($.browser.version) <= 6) {
    // IE6 does not support position:'fixed'.
    // Lock the window scrollBar instead.
    if (isOpen) {
      var yPos = $window.scrollTop();
      var xPos = $window.scrollLeft();
      $window.bind(self.eventHandlerName('scroll'), function() {      // This is line 605
        window.scrollTo(xPos, yPos);
        // Default browser action cannot be prevented here.
      });
    }
    else {
      $window.unbind(self.eventHandlerName('scroll'));
    }
  }

Note that this is only executed when $.browser.version is 6 or lower.

I think I'll have to debug this on a system with IE8, to understand why $.browser.version is 6 or lower in IE8. :-/

markus_petrux’s picture

Status: Active » Needs review

Just looking at the code, it seems there's in fact a bug. So, could you please apply this change to parent.js ?

 Drupal.modalFrame.fixPosition = function($element, isOpen) {
-  var $window = $(window);
+  var self = this, $window = $(window);
   if ($.browser.msie && parseInt($.browser.version) <= 6) {

The error seems to be that 'self' was not defined.

Another issue is find out why $.browser.version is 6 or lower in IE8 and fix that as well.

tomsm’s picture

ok, applied the change...and solved! Thanks!

markus_petrux’s picture

Thanks for the feadback. I'll commit this in a minute.

In regards to IE6 detection... here's a couple of links for reference:

http://blogs.msdn.com/ie/archive/2009/01/09/the-internet-explorer-8-user...
http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using...

In the end, I think I'll leave the detection code as-is, mostly because once the 'self' is defined, it works. The issue with browser detection in IE8 seems to be that it switches the user agent string based on compatibility mode, and that may fool this kind of conditional execution. However, since it seems to work, it looks like leaving it as-is could be ok.

markus_petrux’s picture

Title: IE8 - javascript error - window does not open » IE issue - Object doesn't support this property or method in js/parent.js line 605
Status: Needs review » Fixed

Better title, and patch committed to CVS:

http://drupal.org/cvs?commit=309776

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

shijobaby’s picture

HongPong’s picture

Issue summary: View changes

I got rid of a similar error with a polyfill. it worked fine right in my theme (affecting IE11)

see https://stackoverflow.com/questions/31119300/ie11-object-doesnt-support-...