@@ -98,8 +98,6 @@ export default class EmbeddedQueryControlPlugin extends Plugin {
9898 let searchView = viewCreator ( leaf ) as SearchView ;
9999 plugin . SearchHeaderDOM = searchView . backlink . headerDom . constructor as typeof SearchHeaderDOM ;
100100 } ) ;
101- } else {
102- this . getSearchExport ( ) ;
103101 }
104102
105103 // The only way to obtain the EmbeddedSearch class is to catch it while it's being added to a parent component
@@ -157,21 +155,6 @@ export default class EmbeddedQueryControlPlugin extends Plugin {
157155 return searchHeader ?. constructor ;
158156 }
159157
160- getSearchExport ( ) {
161- const plugin = this ;
162- let searchView : any = this . app . workspace . getLeavesOfType ( "search" ) ?. first ( ) ?. view ;
163- let uninstall = around ( Modal . prototype , {
164- open ( old : any ) {
165- return function ( ...args : any [ ] ) {
166- plugin . SearchResultsExport = this . constructor ;
167- return ;
168- } ;
169- } ,
170- } ) ;
171- searchView ?. onCopyResultsClick ( new MouseEvent ( null ) ) ;
172- uninstall ( ) ;
173- }
174-
175158 onunload ( ) : void { }
176159
177160 patchNativeSearch ( searchView : SearchView ) {
@@ -291,7 +274,7 @@ export default class EmbeddedQueryControlPlugin extends Plugin {
291274 handleBacklinks ( this , plugin , containerEl , backlinksInstance ) ;
292275 }
293276 }
294-
277+
295278 // are we in a native search view?
296279 if ( ! this . parent ?. searchParamsContainerEl ?. patched && this . el ?. parentElement ?. getAttribute ( "data-type" ) === "search" ) {
297280 this . parent . searchParamsContainerEl . patched = true ;
@@ -309,7 +292,7 @@ export default class EmbeddedQueryControlPlugin extends Plugin {
309292 } ) ;
310293 } )
311294 }
312-
295+
313296 // are we in a embedded search view?
314297 if ( ! this . patched && this . el . parentElement ?. hasClass ( "internal-query" ) ) {
315298 let _SearchHeaderDOM = plugin . SearchHeaderDOM ? plugin . SearchHeaderDOM : plugin . getSearchHeader ( ) ;
@@ -364,7 +347,7 @@ export default class EmbeddedQueryControlPlugin extends Plugin {
364347 event . preventDefault ( ) ;
365348 new plugin . SearchResultsExport ( this . app , this ) . open ( ) ;
366349 } ;
367-
350+
368351 let headerDom = ( this . headerDom = new _SearchHeaderDOM ( this . app , this . el . parentElement ) ) ;
369352 defaultHeaderEl . insertAdjacentElement ( "afterend" , headerDom . navHeaderEl ) ;
370353 this . collapseAllButtonEl = headerDom . addNavButton (
0 commit comments