@@ -8,7 +8,7 @@ export function buildShuffleButton(pageType, channelId, clickHandler) {
88 let buttonDivID = "youtube-random-video-shuffle-button" ;
99 let buttonDivExtraStyle = "" ;
1010 let buttonDivOwner = null ;
11- let buttonDivPrepend = true ;
11+ let buttonDivAppend = true ;
1212
1313 // Depending on the type of page we're on, we might need to change certain parts of the button
1414 switch ( pageType ) {
@@ -20,7 +20,6 @@ export function buildShuffleButton(pageType, channelId, clickHandler) {
2020 buttonDivID = "youtube-random-video-shuffle-button-video" ;
2121 buttonDivExtraStyle = "margin-left: 8px;" ;
2222 buttonDivOwner = document . getElementById ( "above-the-fold" ) . children . namedItem ( "top-row" ) . children . namedItem ( "owner" ) ;
23- buttonDivPrepend = false ;
2423 break ;
2524 default :
2625 console . warn ( `Cannot build button: Unknown page type: ${ pageType } ` ) ;
@@ -69,11 +68,11 @@ export function buildShuffleButton(pageType, channelId, clickHandler) {
6968 </div>` ;
7069 buttonDiv = new DOMParser ( ) . parseFromString ( buttonDiv , "text/html" ) . body . firstChild ;
7170
72- // Depending on the page we're on, we wat to prepend or append the button to the owner
73- if ( buttonDivPrepend ) {
74- buttonDivOwner . prepend ( buttonDiv ) ;
75- } else {
71+ // Depending on the page we're on, we may want to prepend or append the button to the parent
72+ if ( buttonDivAppend ) {
7673 buttonDivOwner . appendChild ( buttonDiv ) ;
74+ } else {
75+ buttonDivOwner . prepend ( buttonDiv ) ;
7776 }
7877
7978 // Wait for the button renderer to get the child elements defined by the element type
@@ -117,7 +116,7 @@ function finalizeButton(pageType, channelId, clickHandler) {
117116 <button
118117 class="yt-spec-button-shape-next yt-spec-button-shape-next--tonal yt-spec-button-shape-next--mono yt-spec-button-shape-next--size-m"
119118 aria-label="Shuffle from this channel">
120- <span class="material-symbols-outlined">
119+ <span class="material-symbols-outlined" style="width: 24.01px; overflow: hidden;" >
121120 shuffle
122121 </span>
123122 <div class="cbox yt-spec-button-shape-next--button-text-content">
0 commit comments