OPDS catalog, Cloud storage: hold return arrow to go to top (#7845)

reviewable/pr7903/r1
hius07 3 years ago committed by GitHub
parent dde732c17f
commit db60ba48b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -712,4 +712,17 @@ function CloudStorage:onReturn()
return true
end
function CloudStorage:onHoldReturn()
if #self.paths > 1 then
local path = self.paths[1]
if path then
for i = #self.paths, 2, -1 do
table.remove(self.paths)
end
self:openCloudServer(path.url)
end
end
return true
end
return CloudStorage

@ -884,6 +884,9 @@ function Menu:init()
callback = function()
if self.onReturn then self:onReturn() end
end,
hold_callback = function()
if self.onHoldReturn then self:onHoldReturn() end
end,
bordersize = 0,
show_parent = self.show_parent,
readonly = self.return_arrow_propagation,

@ -884,6 +884,20 @@ function OPDSBrowser:onReturn()
return true
end
function OPDSBrowser:onHoldReturn()
if #self.paths > 1 then
local path = self.paths[1]
if path then
for i = #self.paths, 2, -1 do
table.remove(self.paths)
end
self.catalog_title = path.title
self:updateCatalog(path.url, path.username, path.password)
end
end
return true
end
function OPDSBrowser:onNext()
-- self.page_num comes from menu.lua
local page_num = self.page_num
@ -898,7 +912,6 @@ function OPDSBrowser:onNext()
break
end
end
return true
end

Loading…
Cancel
Save