Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Definition of slider card margin should be dynamically defined #860

Open
briankalwat opened this issue Aug 4, 2016 · 2 comments
Open

Definition of slider card margin should be dynamically defined #860

briankalwat opened this issue Aug 4, 2016 · 2 comments

Comments

@briankalwat
Copy link
Member

The margin values that are defined here should probably be dynamically generated from Junction so that they will always be consistent with the system as a whole.

https://github.com/NewSpring/Apollos/blob/master/sites/newspring/imports/pages/series/series.VideoList.jsx#L47

if (typeof window != "undefined" || window != null) {
      let itemSize = (window.innerWidth - 40) * 0.8; // four-fifths
      itemSize += 20; // account for margin
      const items = this.props.sermons.content.sermons.length;
      const width = (items * itemSize) + 40;
      return {
        width: `${width}px`
}
@briankalwat
Copy link
Member Author

briankalwat commented Aug 4, 2016

fwiw, this is what I ended up using.

window.getComputedStyle(element, null).getPropertyValue("margin-right").replace('px','')

@johnthepink
Copy link
Contributor

@briankalwat thanks! yea we should totally make this dynamic.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants