Fix new linter errors.

pull/181/head
Glen Cheney 7 years ago
parent 2166379ded
commit 83e3ad4958

@ -3,7 +3,7 @@ const e = document.createElement('div');
e.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;'; e.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;';
element.appendChild(e); element.appendChild(e);
const width = window.getComputedStyle(e, null).width; const { width } = window.getComputedStyle(e, null);
const ret = width === '10px'; const ret = width === '10px';
element.removeChild(e); element.removeChild(e);

@ -11,8 +11,10 @@ import COMPUTED_SIZE_INCLUDES_PADDING from './computed-size';
* will return 'auto' when the element doesn't have margins instead of * will return 'auto' when the element doesn't have margins instead of
* the computed style. * the computed style.
*/ */
export default function getNumberStyle(element, style, export default function getNumberStyle(
styles = window.getComputedStyle(element, null)) { element, style,
styles = window.getComputedStyle(element, null),
) {
let value = getNumber(styles[style]); let value = getNumber(styles[style]);
// Support IE<=11 and W3C spec. // Support IE<=11 and W3C spec.

@ -100,7 +100,9 @@ export function getShortColumn(positions, buffer) {
* @param {number} buffer Vertical buffer for the height of items. * @param {number} buffer Vertical buffer for the height of items.
* @return {Point} * @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 span = getColumnSpan(itemSize.width, gridSize, total, threshold);
const setY = getAvailablePositions(positions, span, total); const setY = getAvailablePositions(positions, span, total);
const shortColumnIndex = getShortColumn(setY, buffer); const shortColumnIndex = getShortColumn(setY, buffer);

@ -310,15 +310,13 @@ class Shuffle extends TinyEmitter {
* @protected * @protected
*/ */
setItemTransitions(items) { setItemTransitions(items) {
const speed = this.options.speed; const { speed, easing } = this.options;
const easing = this.options.easing;
const positionProps = this.options.useTransforms ? ['transform'] : ['top', 'left']; const positionProps = this.options.useTransforms ? ['transform'] : ['top', 'left'];
// Allow users to transtion other properties if they exist in the `before` // Allow users to transtion other properties if they exist in the `before`
// css mapping of the shuffle item. // css mapping of the shuffle item.
const properties = positionProps.concat( const cssProps = Object.keys(ShuffleItem.Css.HIDDEN.before).map(k => hyphenate(k));
Object.keys(ShuffleItem.Css.HIDDEN.before).map(k => hyphenate(k)), const properties = positionProps.concat(cssProps).join();
).join();
items.forEach((item) => { items.forEach((item) => {
item.element.style.transitionDuration = speed + 'ms'; item.element.style.transitionDuration = speed + 'ms';
@ -1069,7 +1067,7 @@ class Shuffle extends TinyEmitter {
// Save current duration and delay. // Save current duration and delay.
const data = elements.map((element) => { const data = elements.map((element) => {
const style = element.style; const { style } = element;
const duration = style.transitionDuration; const duration = style.transitionDuration;
const delay = style.transitionDelay; const delay = style.transitionDelay;

Loading…
Cancel
Save