Changeset 7762
- Timestamp:
- 10/23/2018 05:04:37 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-feedback.js
r7754 r7762 7 7 var wpAdminBar = 0; 8 8 var options = wporg_note_feedback; 9 var comments = $( '.comment' ); 9 10 var feedbackToggle = $( '<a role="button" class="feedback-toggle" href="#">' + options.show + '</a>' ); 10 11 var commentID = window.location.hash; … … 28 29 29 30 // Loop through feedback notes 30 $( '.comment' ).each( function() {31 comments.each( function() { 31 32 var feedbackLinks = $( this ).find( '.feedback-links' ); 32 33 var childComments = $( this ).find( 'ul.children' ); … … 86 87 // Set wpAdminBar 87 88 wpAdminBar = $('#wpadminbar').length ? 32 : 0; 88 var childComments = $( '.comment' ).find( 'ul.children' );89 var childComments = comments.find( 'ul.children' ); 89 90 90 91 if ( ! ( commentID.length && childComments.length ) ) { … … 92 93 } 93 94 94 var c omment = childComments.find( commentID + '.depth-2' ).first();95 if ( ! c omment.length ) {95 var childComment = childComments.find( commentID + '.depth-2' ).first(); 96 if ( ! childComment.length ) { 96 97 return; 97 98 } 98 99 // Child comment exists. 99 100 100 var parent = c omment.closest( '.comment.depth-1' );101 var parent = childComment.closest( '.comment.depth-1' ); 101 102 if ( parent.find( '.feedback' ).hasClass( 'hide-if-js' ) ) { 102 103 // Show child comments. … … 105 106 106 107 // Scroll to child comment and adjust for admin bar 107 var pos = c omment.offset();108 var pos = childComment.offset(); 108 109 $( 'html,body' ).animate( { 109 110 scrollTop: pos.top - wpAdminBar … … 113 114 114 115 // Click event for Show/Hide feedback toggle link. 115 $( document ).on( 'click', '.feedback-toggle', function( e ) {116 comments.on( 'click', '.feedback-toggle', function( e ) { 116 117 e.preventDefault(); 117 118 … … 161 162 162 163 // Show editor when the add feedback link is clicked. 163 $( document ).on( 'click', '.feedback-add', function( e ) {164 comments.on( 'click', '.feedback-add', function( e ) { 164 165 e.preventDefault(); 165 166
Note: See TracChangeset
for help on using the changeset viewer.