Make each section of presenter state self-contained

This means we have some duplicated values in different parts of the
tree, but it’s cleaner in the view since each component only consumes
a single object. Seems like the presenter should convey the correct
data to the correct locations and minimize the logic in the view. A
few duplicated integers is a reasonable trade-off.
This commit is contained in:
Nathan Sobo
2015-01-29 14:27:53 -07:00
parent da4b3a47ef
commit bbc1a264b5
7 changed files with 238 additions and 110 deletions

View File

@@ -27,8 +27,7 @@ class OverlayManager
itemHeight = item.offsetHeight
{scrollTop} = presenter.state
{scrollLeft} = presenter.state.content
{scrollTop, scrollLeft} = presenter.state.content
left = pixelPosition.left
if left + itemWidth - scrollLeft > presenter.getContentFrameWidth() and left - itemWidth >= scrollLeft