2023-12-26 14:48:33 +03:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M:peek()
|
|
|
|
local _, bound = ya.preview_archive(self)
|
|
|
|
if bound then
|
2024-04-22 09:18:00 +03:00
|
|
|
ya.manager_emit("peek", { bound, only_if = self.file.url, upper_bound = true })
|
2023-12-26 14:48:33 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function M:seek(units)
|
|
|
|
local h = cx.active.current.hovered
|
|
|
|
if h and h.url == self.file.url then
|
|
|
|
local step = math.floor(units * self.area.h / 10)
|
|
|
|
ya.manager_emit("peek", {
|
2024-03-01 05:22:12 +03:00
|
|
|
math.max(0, cx.active.preview.skip + step),
|
2024-04-22 09:18:00 +03:00
|
|
|
only_if = self.file.url,
|
2023-12-26 14:48:33 +03:00
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|