feat: daily notes (dev only) (#1894)
This commit is contained in:
@@ -287,18 +287,22 @@ export class SelectedItemsController
|
||||
item: {
|
||||
uuid: ListableContentItem['uuid']
|
||||
},
|
||||
{ userTriggered = false, scrollIntoView = true },
|
||||
{ userTriggered = false, scrollIntoView = true, animated = true },
|
||||
): Promise<void> => {
|
||||
const { didSelect } = await this.selectItem(item.uuid, userTriggered)
|
||||
|
||||
if (didSelect && scrollIntoView) {
|
||||
const itemElement = document.getElementById(item.uuid)
|
||||
itemElement?.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
})
|
||||
this.scrollToItem(item, animated)
|
||||
}
|
||||
}
|
||||
|
||||
scrollToItem = (item: { uuid: ListableContentItem['uuid'] }, animated = true): void => {
|
||||
const itemElement = document.getElementById(item.uuid)
|
||||
itemElement?.scrollIntoView({
|
||||
behavior: animated ? 'smooth' : 'auto',
|
||||
})
|
||||
}
|
||||
|
||||
selectUuids = async (uuids: UuidString[], userTriggered = false) => {
|
||||
const itemsForUuids = this.application.items.findItems(uuids)
|
||||
if (itemsForUuids.length < 1) {
|
||||
|
||||
Reference in New Issue
Block a user