parent
bf059c0f8c
commit
02f6ec921c
|
@ -109,7 +109,6 @@ sub removeHomeSection(sectionType as string)
|
||||||
end for
|
end for
|
||||||
|
|
||||||
m.homeSectionIndexes.Delete(sectionName)
|
m.homeSectionIndexes.Delete(sectionName)
|
||||||
m.homeSectionIndexes.AddReplace("count", m.homeSectionIndexes.count - 1)
|
|
||||||
|
|
||||||
m.top.content.removeChildIndex(removedSectionIndex)
|
m.top.content.removeChildIndex(removedSectionIndex)
|
||||||
end sub
|
end sub
|
||||||
|
@ -408,10 +407,12 @@ sub updateLatestInRows()
|
||||||
loadLatest.itemsToLoad = "latest"
|
loadLatest.itemsToLoad = "latest"
|
||||||
loadLatest.itemId = lib.id
|
loadLatest.itemId = lib.id
|
||||||
|
|
||||||
metadata = { "title": lib.name }
|
metadata = {
|
||||||
metadata.Append({ "contentType": lib.json.CollectionType })
|
"title": lib.name,
|
||||||
loadLatest.metadata = metadata
|
"contentType": lib.json.CollectionType
|
||||||
|
}
|
||||||
|
|
||||||
|
loadLatest.metadata = metadata
|
||||||
loadLatest.observeField("content", "updateLatestItems")
|
loadLatest.observeField("content", "updateLatestItems")
|
||||||
loadLatest.control = "RUN"
|
loadLatest.control = "RUN"
|
||||||
end if
|
end if
|
||||||
|
@ -429,8 +430,6 @@ sub updateLatestItems(msg)
|
||||||
|
|
||||||
sectionName = "latestin" + LCase(node.metadata.title).Replace(" ", "")
|
sectionName = "latestin" + LCase(node.metadata.title).Replace(" ", "")
|
||||||
|
|
||||||
rowIndex = m.homeSectionIndexes[sectionName]
|
|
||||||
|
|
||||||
if itemData.count() < 1
|
if itemData.count() < 1
|
||||||
removeHomeSection(sectionName)
|
removeHomeSection(sectionName)
|
||||||
return
|
return
|
||||||
|
@ -457,9 +456,42 @@ sub updateLatestItems(msg)
|
||||||
row.appendChild(item)
|
row.appendChild(item)
|
||||||
end for
|
end for
|
||||||
|
|
||||||
' replace the old row
|
rowIndex = m.homeSectionIndexes[sectionName]
|
||||||
updateSizeArray(itemSize, rowIndex, "replace")
|
|
||||||
m.top.content.replaceChild(row, rowIndex)
|
' Replace the old row
|
||||||
|
if isValid(rowIndex)
|
||||||
|
updateSizeArray(itemSize, rowIndex, "replace")
|
||||||
|
m.top.content.replaceChild(row, rowIndex)
|
||||||
|
return
|
||||||
|
end if
|
||||||
|
|
||||||
|
' Determine highest index of a Lastest In section so we can append the new section after it
|
||||||
|
highestLatestHomeSectionIndex = 0
|
||||||
|
|
||||||
|
for each section in m.homeSectionIndexes
|
||||||
|
if LCase(Left(section, 6)) = "latest"
|
||||||
|
if m.homeSectionIndexes[section] > highestLatestHomeSectionIndex
|
||||||
|
highestLatestHomeSectionIndex = m.homeSectionIndexes[section]
|
||||||
|
end if
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
|
' We have data for a section that doesn't currently exist
|
||||||
|
rowIndex = highestLatestHomeSectionIndex + 1
|
||||||
|
|
||||||
|
' Advance all the indexes greater than or equal than our new row
|
||||||
|
for each section in m.homeSectionIndexes
|
||||||
|
if m.homeSectionIndexes[section] >= rowIndex
|
||||||
|
m.homeSectionIndexes[section]++
|
||||||
|
end if
|
||||||
|
end for
|
||||||
|
|
||||||
|
m.homeSectionIndexes.AddReplace(sectionName, rowIndex)
|
||||||
|
|
||||||
|
m.top.content.insertChild(row, rowIndex)
|
||||||
|
updateSizeArray(itemSize, rowIndex)
|
||||||
|
|
||||||
|
return
|
||||||
end if
|
end if
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user