Skip to content

Commit 52b8a90

Browse files
committed
resolve loading issues, update tsconfig
1 parent b7e397f commit 52b8a90

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

src/main.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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(

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
"inlineSourceMap": true,
55
"inlineSources": true,
66
"module": "ESNext",
7-
"target": "ES6",
7+
"target": "ESNext",
88
"allowJs": true,
99
"noImplicitAny": true,
1010
"moduleResolution": "node",
1111
"importHelpers": true,
12+
"strict": true,
1213
"lib": [
1314
"DOM",
14-
"ES5",
15-
"ES6",
16-
"ES7",
1715
"ESNext"
1816
]
1917
},

0 commit comments

Comments
 (0)