Skip to content

Commit

Permalink
Comments: refactor jQuery usage (#20347)
Browse files Browse the repository at this point in the history
Refactor small jQuery usage in favor of plain JS, fixes potential `Uncaught ReferenceError: jQuery is not defined` error.
  • Loading branch information
samiff authored Jul 14, 2021
1 parent 17db0de commit 8fce207
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/2021-07-13-20-10-58-559738
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Comments: refactor jQuery usage.
4 changes: 2 additions & 2 deletions projects/plugins/jetpack/modules/comments/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,15 @@ public function watch_comment_parent() {
if ( iframe_url.replace( /^http:\/\//i, 'https://' ) !== origin ) {
return;
}
jQuery( frame ).height( event.data );
frame.style.height = event.data + 'px';
});
} else if ( document.attachEvent ) {
window.attachEvent( 'message', function ( event ) {
var origin = event.origin.replace( /^http:\/\//i, 'https://' );
if ( iframe_url.replace( /^http:\/\//i, 'https://' ) !== origin ) {
return;
}
jQuery( frame ).height( event.data );
frame.style.height = event.data + 'px';
});
}
}
Expand Down

0 comments on commit 8fce207

Please sign in to comment.