NewSpring / Holtzman

The main NewSpring namespace and utilities for all newspring packages.
http://holtzman.newspring.io/
Other
24 stars 10 forks source link

Definition of slider card margin should be dynamically defined #860

Open briankalwat opened 8 years ago

briankalwat commented 8 years ago

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 commented 8 years ago

fwiw, this is what I ended up using.

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

johnthepink commented 8 years ago

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