Skip to content

Commit

Permalink
Fix dataset source outside of the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlende committed Jul 28, 2020
1 parent f0b061a commit f7c0136
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions blocks/waves/waves.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@
.querySelectorAll( '.wp-block-a8c-waves canvas' )
.forEach( ( canvas ) => {
const dataset = {
color1: parseColor( dataset.color1 ),
color2: parseColor( dataset.color2 ),
color3: parseColor( dataset.color3 ),
color4: parseColor( dataset.color4 ),
complexity: Number.parseInt( dataset.complexity, 10 ),
mouseSpeed: Number.parseFloat( dataset.mouseSpeed ),
fluidSpeed: Number.parseFloat( dataset.fluidSpeed ),
color1: parseColor( canvas.dataset.color1 ),
color2: parseColor( canvas.dataset.color2 ),
color3: parseColor( canvas.dataset.color3 ),
color4: parseColor( canvas.dataset.color4 ),
complexity: Number.parseInt(
canvas.dataset.complexity,
10
),
mouseSpeed: Number.parseFloat(
canvas.dataset.mouseSpeed
),
fluidSpeed: Number.parseFloat(
canvas.dataset.fluidSpeed
),
};
run( canvas, dataset );
} );
Expand Down

0 comments on commit f7c0136

Please sign in to comment.