flekschas / piling.js

A general framework and library for exploring thousands of small multiples

Home Page:https://piling.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entangle updateCover and updatePreviewStyle

flekschas opened this issue · comments

After some recent refactoring, we now have a updateCover() function but this function is calling
updatePreviewStyle() which is a little bit confusing because the preview styles should also be updated even when there is no cover.

Hi Fritz, I'm not sure what should I do here. Should I separate updatePreviewStyle() from uppdateCover()?

Yep :) This is not an important issue, I just recently played with previews and no cover and was looking for the code that was updating the style of the preview. it took me a little bit to find it because the function is bound to updateCover, which is a bit confusing as I didn't have a cover.

So the goal is to separate updatePreviewStyle() from updateCover() as the two should really be independent. If there is some logic combining the two we could maybe introduce a new function called updatePreviewsAndCover which then calls updateCover and updatePreviewStyle if necessary