When using jQuery3 the admin modal height extends below the viewport without a scrollbar making the hidden options inaccessible.
This is due to calls to outerHeight() with an undefined selector returning undefined rather than null as they used to.
In Javascript adding null to a value is equivalent to adding 0, however adding undefined results in the value becoming NaN (Not-A-Number), which is the root cause of the scrollbar not appearing issue.
This can be worked around in a backwards compatible manner by ORing with 0, if outerHeight() returns a valid number it will be used, otherwise the ORd 0 will be used.
js/views-admin.js
// Now, calculate what the difference between the scroll and the modal
// will be.
var difference = 0;
difference += parseInt($scroll.css('padding-top'));
difference += parseInt($scroll.css('padding-bottom'));
- difference += $('.views-override').outerHeight(true);
- difference += $('.views-messages').outerHeight(true);
- difference += $('#views-ajax-title').outerHeight(true);
- difference += $('.views-add-form-selected').outerHeight(true);
- difference += $('.form-buttons', $modal).outerHeight(true);
+ difference += $('.views-override').outerHeight(true) || 0;
+ difference += $('.views-messages').outerHeight(true) || 0;
+ difference += $('#views-ajax-title').outerHeight(true) || 0;
+ difference += $('.views-add-form-selected').outerHeight(true) || 0;
+ difference += $('.form-buttons', $modal).outerHeight(true) || 0;
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2916772-4.patch | 1016 bytes | rpayanm |
Comments
Comment #2
mustanggb commentedComment #3
mustanggb commentedAnother easy straight forward fix.
Comment #4
rpayanmPlease review.
Comment #5
mustanggb commentedComment #7
damienmckennaCommitted. Thanks!