diff --git a/src/computed-size.js b/src/computed-size.js index bc4b76a..a88272d 100644 --- a/src/computed-size.js +++ b/src/computed-size.js @@ -3,7 +3,7 @@ const e = document.createElement('div'); e.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;'; element.appendChild(e); -const width = window.getComputedStyle(e, null).width; +const { width } = window.getComputedStyle(e, null); const ret = width === '10px'; element.removeChild(e); diff --git a/src/get-number-style.js b/src/get-number-style.js index 59b1062..2c0e2cc 100644 --- a/src/get-number-style.js +++ b/src/get-number-style.js @@ -11,8 +11,10 @@ import COMPUTED_SIZE_INCLUDES_PADDING from './computed-size'; * will return 'auto' when the element doesn't have margins instead of * the computed style. */ -export default function getNumberStyle(element, style, - styles = window.getComputedStyle(element, null)) { +export default function getNumberStyle( + element, style, + styles = window.getComputedStyle(element, null), +) { let value = getNumber(styles[style]); // Support IE<=11 and W3C spec. diff --git a/src/layout.js b/src/layout.js index f9420f7..f3dfc9c 100644 --- a/src/layout.js +++ b/src/layout.js @@ -100,7 +100,9 @@ export function getShortColumn(positions, buffer) { * @param {number} buffer Vertical buffer for the height of items. * @return {Point} */ -export function getItemPosition({ itemSize, positions, gridSize, total, threshold, buffer }) { +export function getItemPosition({ + itemSize, positions, gridSize, total, threshold, buffer, +}) { const span = getColumnSpan(itemSize.width, gridSize, total, threshold); const setY = getAvailablePositions(positions, span, total); const shortColumnIndex = getShortColumn(setY, buffer); diff --git a/src/shuffle.js b/src/shuffle.js index b475a99..62fc026 100644 --- a/src/shuffle.js +++ b/src/shuffle.js @@ -310,15 +310,13 @@ class Shuffle extends TinyEmitter { * @protected */ setItemTransitions(items) { - const speed = this.options.speed; - const easing = this.options.easing; + const { speed, easing } = this.options; const positionProps = this.options.useTransforms ? ['transform'] : ['top', 'left']; // Allow users to transtion other properties if they exist in the `before` // css mapping of the shuffle item. - const properties = positionProps.concat( - Object.keys(ShuffleItem.Css.HIDDEN.before).map(k => hyphenate(k)), - ).join(); + const cssProps = Object.keys(ShuffleItem.Css.HIDDEN.before).map(k => hyphenate(k)); + const properties = positionProps.concat(cssProps).join(); items.forEach((item) => { item.element.style.transitionDuration = speed + 'ms'; @@ -1069,7 +1067,7 @@ class Shuffle extends TinyEmitter { // Save current duration and delay. const data = elements.map((element) => { - const style = element.style; + const { style } = element; const duration = style.transitionDuration; const delay = style.transitionDelay;