Due to missing check for length of jQuery object when quering for #modalContent IE throws a javascript error when closing modal window and trying to access nonexisting element.

Other browsers are a bit more relaxed throwing the error.

Checking for length solves the problem which also exists in the 7.x-1.x branch where problem originally was spotted.

Problematic code:
if ( $('#modalContent')) $('#modalContent').get(0).focus();

Comments

chemical’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, jquery_object_always_true_whether_empty_or_not.diff, failed testing.

chemical’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review

Changed version to 7.x-1.x-dev due to missing PHP classes in 8.x-1.x-dev

Status: Needs review » Needs work

The last submitted patch, jquery_object_always_true_whether_empty_or_not.diff, failed testing.

mrjmd’s picture

Status: Needs work » Needs review
StatusFileSize
new711 bytes

Re-rolled with comment typo fix.

damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

Short 'n sweet. RTBC.

mrjmd’s picture

japerry’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2015

I'm trusting that the IE users tested and approved this ;) committed.

  • japerry committed 193972b on 7.x-1.x authored by chemical
    Issue #2307025 by chemical, mrjmd: jQuery object always represent value...

Status: Fixed » Closed (fixed)

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