Highlights: extend (#13815)

This commit is contained in:
hius07 authored and GitHub committed 2025-05-22 17:59:44 +03:00
1 parent 905ee56566
commit d358b26d61
2 files changed
+36 -14

No files matched your search

@@ -503,7 +503,7 @@ function ReaderAnnotation:getInsertionIndex(item)
end
function ReaderAnnotation:addItem(item)
item.datetime = os.date("%Y-%m-%d %H:%M:%S")
item.datetime = item.datetime or os.date("%Y-%m-%d %H:%M:%S")
item.pageno = self.ui.rolling and self.document:getPageFromXPointer(item.page) or item.page
item.pageref = self:getPageRef(item.page, item.pageno)
local index = self:getInsertionIndex(item)
@@ -512,7 +512,7 @@ function ReaderAnnotation:addItem(item)
end
function ReaderAnnotation:onAnnotationsModified(items)
if items.index_modified == nil then -- not needed when annotation added or removed
if items.index_modified == nil or items.modify_datetime then -- not needed when annotation added or removed
items[1].datetime_updated = os.date("%Y-%m-%d %H:%M:%S")
end
end