Problem/Motivation

When activating jquery_update with 1.9 or above, the module throws a javascript error
"Uncaught TypeError: Cannot read property 'msie' of undefined"

Also, showing / hiding the field does'nt work well on Android: the field isn't shown or hidden instantaniously, only after a second click.

Proposed resolution

The $.browser.msie check is used to determine the browser and which jquery Action to use for showing and hiding the extra field. According to the code 'click' should be used when Internet Explorer and 'change' should be used in other cases.

Problem is that $.browser is deprecated since jquery 1.3 and removed from 1.9, as 'feature checks' should be used instead of 'browser' checks.

I tried the 'click' event on firefox, chrome and IE, and didn't find any issues, so I think this check can be removed overall. I'm preparing a patch for the 7.x-1.x branch, although the issue also exists for 7.x-2.x

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nuez created an issue. See original summary.

nuez’s picture

Fixed the msie issue simply by removing the msie check and using only the 'click' event.

The issue of the android is caused by the fact that the visibility is updated using inline CSS statements. Instead I used the jquery hide and show methods, which seem to work for android.

nuez’s picture

Status: Active » Needs review

Status: Needs review » Needs work
mradcliffe’s picture

Hmm... It looks like the patch file is just the patch file name.

Thanks for catching this. Yes, should fix that so it works with either an older jquery or a newer one.

nuez’s picture

Status: Needs work » Needs review
FileSize
1.71 KB

Sorry about, you're quicker than I expected. Fixed the patch.

Also had another look at it. The Jquery changed method will work on most browsers, and doesn't work on IE 6,7, maybe 8,

In any case non of those browsers are supported any more, so I think we can remove the condition.

nuez’s picture

I've checked this on IE developer tools in IE 5,7,8 mode, and it works for all of the versions. But That could be because the IE developer tool doesn't take into account javascript functionality...

mradcliffe’s picture

Sweet.

I added ActionBind back in order to be backwards-compatible with core's jQuery.

nuez’s picture

It looks like it's working correctly. thanks

  • mradcliffe committed 115207a on 7.x-1.x authored by nuez
    Issue #2706517 by nuez: Remove MSIE browser detection which is not...
  • mradcliffe committed 8b7c21e on 7.x-1.x
    Issue #2706517 by mradcliffe: Make JQuery 1.9 fix backwards-compatible.
    
mradcliffe’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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