Skip to content
This repository was archived by the owner on Aug 6, 2019. It is now read-only.

Update gradients.js#40

Merged
brandonaaron merged 1 commit intobrandonaaron:masterfrom
atotic:patch-1
Mar 7, 2013
Merged

Update gradients.js#40
brandonaaron merged 1 commit intobrandonaaron:masterfrom
atotic:patch-1

Conversation

@atotic
Copy link
Contributor

@atotic atotic commented Mar 7, 2013

Bug: hook did not work on multiple gradients.
Why: "".replace(str, ) only replaces first occurence
Fix: Use regex as an argument to "".replace

This fixed multiple gradients for me.

Example bad css:
$(document.body).css({
background: 'linear-gradient(135deg, #708090 22px, #d9ecff 22px, #d9ecff 24px, transparent 24px, transparent 67px, #d9ecff 67px, #d9ecff 69px, transparent 69px), linear-gradient(225deg, #708090 22px, #d9ecff 22px, #d9ecff 24px, transparent 24px, transparent 67px, #d9ecff 67px, #d9ecff 69px, transparent 69px) 0 64px'});

Bug: hook did not work on multiple gradients. 
Why: "".replace(str, ) only replaces first occurence
Fix: Use regex as an argument to "".replace

This fixed multiple gradients for me.
brandonaaron added a commit that referenced this pull request Mar 7, 2013
@brandonaaron brandonaaron merged commit 352b5f9 into brandonaaron:master Mar 7, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants