Skip to content

Commit

Permalink
Don't show extras slider if nothing to show
Browse files Browse the repository at this point in the history
  • Loading branch information
jimdogx committed Oct 23, 2024
1 parent 9854860 commit 83c4146
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions components/extras/ExtrasRowList.bs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ sub updateSize()
end sub

sub loadParts(data as object)
m.extrasGrp = m.top.getParent().findNode("extrasGrp")
m.top.parentId = data.id
m.people = data.People
m.LoadAdditionalPartsTask.itemId = m.top.parentId
m.LoadAdditionalPartsTask.control = "RUN"
end sub

sub loadPersonVideos(personId)
m.extrasGrp = m.top.getParent().findNode("extrasGrp")
m.personId = personId
m.LoadMoviesTask.itemId = m.personId
m.LoadMoviesTask.observeField("content", "onMoviesLoaded")
Expand Down Expand Up @@ -114,7 +116,7 @@ sub onLikeThisLoaded()
m.SpecialFeaturesTask.control = "RUN"
end sub

function onSpecialFeaturesLoaded()
sub onSpecialFeaturesLoaded()
data = m.SpecialFeaturesTask.content
m.SpecialFeaturesTask.unobserveField("content")
if data <> invalid and data.count() > 0
Expand All @@ -132,8 +134,8 @@ function onSpecialFeaturesLoaded()
addRowSize([462, 372])
end if

return m.top.content
end function
showOrHideMe()
end sub

sub onMoviesLoaded()
data = m.LoadMoviesTask.content
Expand Down Expand Up @@ -179,6 +181,8 @@ sub onSeriesLoaded()
m.top.content.appendChild(row)
end if
m.top.visible = true

showOrHideMe()
end sub

function buildRow(rowTitle as string, items, imgWdth = 0)
Expand Down Expand Up @@ -218,6 +222,17 @@ sub addRowSize(newRow)
m.top.rowItemSize = newSizeArray
end sub

' don't show popup panel if there is nothing to show
sub showOrHideMe()
if isValid(m.top.content)
if m.top.content.getChildCount() = 0
m.extrasGrp.visible = false
else
m.extrasGrp.visible = true
end if
end if
end sub

sub onRowItemSelected()
m.top.selectedItem = m.top.content.getChild(m.top.rowItemSelected[0]).getChild(m.top.rowItemSelected[1])
end sub
Expand Down
2 changes: 1 addition & 1 deletion components/movies/MovieDetails.bs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
m.options.setFocus(true)
end if

if key = "down" and m.buttonGrp.isInFocusChain()
if key = "down" and m.buttonGrp.isInFocusChain() and m.extrasGrp.visible = true
m.top.lastFocus = m.extrasGrid
m.extrasGrid.setFocus(true)
m.top.findNode("VertSlider").reverse = false
Expand Down

0 comments on commit 83c4146

Please sign in to comment.