mirror of
https://github.com/calvinwyoung/obsidian-backlink-settings.git
synced 2026-07-22 05:45:37 +00:00
Cleaner diff
This commit is contained in:
parent
827a3d3384
commit
9dfe763953
1 changed files with 20 additions and 17 deletions
37
src/main.ts
37
src/main.ts
|
|
@ -63,6 +63,7 @@ export default class BacklinkSettingsPlugin extends Plugin {
|
|||
const collapseButton = embeddedBacklinks.querySelector(
|
||||
"[aria-label='Collapse results']:not(.is-active)"
|
||||
) as HTMLElement;
|
||||
|
||||
if (collapseButton) {
|
||||
(collapseButton as HTMLElement).click();
|
||||
}
|
||||
|
|
@ -89,24 +90,26 @@ export default class BacklinkSettingsPlugin extends Plugin {
|
|||
// Set reverse alphabetical sort order to test.
|
||||
backlinkView?.backlink?.setSortOrder('alphabeticalReverse');
|
||||
|
||||
// const sortButton = embeddedBacklinks.querySelector(
|
||||
// "[aria-label='Change sort order']"
|
||||
// ) as HTMLElement;
|
||||
// if (sortButton) {
|
||||
// // Click the sort button to open the dropdown.
|
||||
// sortButton.click();
|
||||
/*
|
||||
const sortButton = embeddedBacklinks.querySelector(
|
||||
"[aria-label='Change sort order']"
|
||||
) as HTMLElement;
|
||||
if (sortButton) {
|
||||
// Click the sort button to open the dropdown.
|
||||
sortButton.click();
|
||||
|
||||
// // -----------------------
|
||||
// // TODO: This doesn't work.
|
||||
// // -----------------------
|
||||
// // Find and click the desired sort option.
|
||||
// const sortOptions = document.querySelectorAll('.sort-option');
|
||||
// sortOptions.forEach((option) => {
|
||||
// if (option.textContent?.toLowerCase() === this.settings.sortOrder) {
|
||||
// (option as HTMLElement).click();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// -----------------------
|
||||
// TODO: This doesn't work.
|
||||
// -----------------------
|
||||
// Find and click the desired sort option.
|
||||
const sortOptions = document.querySelectorAll('.sort-option');
|
||||
sortOptions.forEach((option) => {
|
||||
if (option.textContent?.toLowerCase() === this.settings.sortOrder) {
|
||||
(option as HTMLElement).click();
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue