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;';
element.appendChild(e);
const width = window.getComputedStyle(e, null).width;
const { width } = window.getComputedStyle(e, null);
const ret = width === '10px';
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
* 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.

@ -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);

@ -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;

Loading…
Cancel
Save