@ebay/ebayui-core
Advanced tools
Comparing version 1.0.6-0 to 1.0.6-canary.7897056
@@ -42,5 +42,9 @@ 'use strict';var expect = require('chai').expect; | ||
el.scrollLeft = to; | ||
// Allow two frames for the on scroll to finish. | ||
// Allow two frames and a timeout for the on scroll to finish. | ||
if (cb) { | ||
waitFrames(2, cb); | ||
requestAnimationFrame(function () { | ||
setTimeout(function () { | ||
requestAnimationFrame(cb); | ||
}, 64); | ||
}); | ||
} | ||
@@ -47,0 +51,0 @@ |
@@ -85,4 +85,2 @@ 'use strict';var _extends = Object.assign || function (target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i];for (var key in source) {if (Object.prototype.hasOwnProperty.call(source, key)) {target[key] = source[key];}}}return target;};var focusables = require('makeup-focusables'); | ||
replace('{totalSlides}', totalSlides); | ||
} else { | ||
itemWidth = 'auto'; | ||
} | ||
@@ -92,3 +90,3 @@ | ||
style = item.style,transform = item.transform; | ||
var marginRight = i !== items.length && gap + 'px'; | ||
var marginRight = i !== items.length - 1 && gap + 'px'; | ||
@@ -101,3 +99,3 @@ // Account for users providing a style string or object for each item. | ||
item.style = _extends({}, style, { | ||
'flex-basis': itemWidth, | ||
'width': itemWidth, | ||
'margin-right': marginRight, | ||
@@ -104,0 +102,0 @@ transform: transform }); |
@@ -13,2 +13,3 @@ 'use strict'; /** | ||
var frame = void 0; | ||
var timeout = void 0; | ||
var stage = 0; | ||
@@ -44,13 +45,15 @@ el.addEventListener('touchmove', handleTouchMove); | ||
function checkScrollEnded(lastOffset) { | ||
frame = requestAnimationFrame(function () { | ||
var newOffset = el.scrollLeft; | ||
if (lastOffset !== newOffset) { | ||
checkScrollEnded(newOffset); | ||
} else { | ||
cancelTouchStart(); | ||
fn(newOffset); | ||
stage = 0; | ||
el.addEventListener('touchmove', handleTouchMove); | ||
} | ||
}); | ||
timeout = setTimeout(function () { | ||
frame = requestAnimationFrame(function () { | ||
var newOffset = el.scrollLeft; | ||
if (lastOffset !== newOffset) { | ||
checkScrollEnded(newOffset); | ||
} else { | ||
cancelTouchStart(); | ||
fn(newOffset); | ||
stage = 0; | ||
el.addEventListener('touchmove', handleTouchMove); | ||
} | ||
}); | ||
}, 64); | ||
} | ||
@@ -72,2 +75,3 @@ | ||
cancelAnimationFrame(frame); | ||
clearTimeout(timeout); | ||
@@ -74,0 +78,0 @@ switch (stage) { |
{ | ||
"name": "@ebay/ebayui-core", | ||
"version": "1.0.6-0", | ||
"version": "1.0.6-canary.7897056", | ||
"description": "Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
903943
5866
1