Use first background repeat value for multiple backgrounds if only 1 available (Edge bug)

This commit is contained in:
Niklas von Hertzen 2017-08-05 21:40:56 +08:00
parent 0224592a96
commit 82a7349e43
2 changed files with 8 additions and 3 deletions

View File

@ -128,14 +128,17 @@ export const cloneWindow = (
if (
/(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&
(cloneWindow.scrollY !== bounds.top ||
cloneWindow.scrollX !== bounds.left)
cloneWindow.scrollX !== bounds.left)
) {
documentClone.documentElement.style.top = -bounds.top + 'px';
documentClone.documentElement.style.left = -bounds.left + 'px';
documentClone.documentElement.style.position = 'absolute';
}
}
if (referenceElementSearch[1] instanceof cloneWindow.HTMLElement || referenceElementSearch[1] instanceof HTMLElement) {
if (
referenceElementSearch[1] instanceof cloneWindow.HTMLElement ||
referenceElementSearch[1] instanceof HTMLElement
) {
resolve([cloneIframeContainer, referenceElementSearch[1]]);
} else {
reject(

View File

@ -292,7 +292,9 @@ const parseBackgroundImages = (
return {
source,
repeat: parseBackgroundRepeat(repeats[index]),
repeat: parseBackgroundRepeat(
typeof repeats[index] === 'string' ? repeats[index] : repeats[0]
),
size: size.length < 2 ? [size[0], AUTO_SIZE] : [size[0], size[1]],
position: position.length < 2 ? [position[0], position[0]] : [position[0], position[1]]
};