Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/js/_enqueues/admin/privacy-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,20 @@ jQuery( function( $ ) {
// Setup copy.
window.getSelection().removeAllRanges();

// Hide tutorial content to remove from copied content.
// Hide tutorial content and the actions toolbar (which contains
// the "Copied!" notice and button label) before selecting, so
// neither ends up in the copied text - see #58969.
range = document.createRange();
$parent.addClass( 'hide-privacy-policy-tutorial' );
$parent.find( '.privacy-settings-accordion-actions' ).addClass( 'hide-privacy-policy-tutorial' );

// Copy action.
range.selectNodeContents( $parent[0] );
window.getSelection().addRange( range );
document.execCommand( 'copy' );

// Reset section.
$parent.find( '.privacy-settings-accordion-actions' ).removeClass( 'hide-privacy-policy-tutorial' );
$parent.removeClass( 'hide-privacy-policy-tutorial' );
window.getSelection().removeAllRanges();

Expand Down
Loading