@@ -145,6 +145,8 @@ class PDFThumbnailViewer {
145145
146146 #statusBar = null ;
147147
148+ #deselectButton = null ;
149+
148150 #undoBar = null ;
149151
150152 #undoLabel = null ;
@@ -183,6 +185,8 @@ class PDFThumbnailViewer {
183185 this . pageColors = pageColors || null ;
184186 this . #enableSplitMerge = enableSplitMerge || false ;
185187 this . #statusLabel = statusBar ?. viewsManagerStatusActionLabel || null ;
188+ this . #deselectButton =
189+ statusBar ?. viewsManagerStatusActionDeselectButton || null ;
186190 this . #statusBar = statusBar ?. viewsManagerStatusAction || null ;
187191 this . #undoBar = undoBar ?. viewsManagerStatusUndo || null ;
188192 this . #undoLabel = undoBar ?. viewsManagerStatusUndoLabel || null ;
@@ -260,6 +264,12 @@ class PDFThumbnailViewer {
260264 "click" ,
261265 this . #dismissUndo. bind ( this )
262266 ) ;
267+ this . #deselectButton?. addEventListener ( "click" , ( ) => {
268+ this . #clearSelection( ) ;
269+ this . #toggleMenuEntries( false ) ;
270+ this . #updateStatus( "select" ) ;
271+ } ) ;
272+ this . #deselectButton. classList . toggle ( "hidden" , true ) ;
263273 } else {
264274 manageMenu . button . hidden = true ;
265275 }
@@ -910,8 +920,10 @@ class PDFThumbnailViewer {
910920 "data-l10n-args" ,
911921 JSON . stringify ( { count } )
912922 ) ;
923+ this . #deselectButton. classList . toggle ( "hidden" , false ) ;
913924 } else {
914925 this . #statusLabel. removeAttribute ( "data-l10n-args" ) ;
926+ this . #deselectButton. classList . toggle ( "hidden" , true ) ;
915927 }
916928 this . #statusBar. classList . toggle ( "hidden" , false ) ;
917929 this . #undoBar. classList . toggle ( "hidden" , true ) ;
0 commit comments