Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
There are 2 methods present in ajax_comments.js, which won't work with jquery versions 1.6 and higher.
attr('scrollHeight') doesn't work for jquery > 1.6
we have to use prop() instead.
@ -57,7 +57,7 @@ Drupal.behaviors.ajaxComments = {
*/
function ajaxCommentsScrollForm(commentNumber) {
pos = $('#comment-wrapper-' + commentNumber).offset();
height = $('#comment-wrapper-' + commentNumber + ' .comment').attr("scrollHeight");
Proposed resolution
Create a helper function to make the code compatible with all jquery versions.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2078949-jquery-update-compatibility-1.patch | 1.27 KB | micbar |
Comments
Comment #1
micbar CreditAttribution: micbar commentedHere is the patch with the proposed resolution.
Comment #2
muschpusch CreditAttribution: muschpusch commentedlooks good too
Comment #3
muschpusch CreditAttribution: muschpusch commentedcommitted to current dev