Skip to content

Commit

Permalink
use window.docExample for proper scoping with linting, phetsims/chipp…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 10, 2023
1 parent 6933d28 commit 36e768b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<!-- eslint-disable --> <!--TODO: fix lint https://github.com/phetsims/chipper/issues/1405-->

<script type="text/javascript">
function docExample( id, draw ) {
window.docExample = ( id, draw ) => {
var canvas = document.getElementById( id );
var context = canvas.getContext( '2d' );
draw( context );
Expand Down Expand Up @@ -262,7 +262,7 @@ <h4 id="shape-moveTo">moveTo( <span class="args">x, y</span> )</h4>
</p>
<canvas id="example-moveTo" class="exampleScene" style="width: 64px; height: 64px; margin: 0 auto;"></canvas>
<script type="text/javascript">
docExample( 'example-moveTo', function( context ) {
window.docExample( 'example-moveTo', function( context ) {
context.canvas.width = 64;
context.canvas.height = 64;
var shape =
Expand All @@ -289,7 +289,7 @@ <h4 id="shape-lineTo">lineTo( <span class="args">x, y</span> )</h4>
</p>
<canvas id="example-lineTo" class="exampleScene" style="width: 64px; height: 64px; margin: 0 auto;"></canvas>
<script type="text/javascript">
docExample( 'example-lineTo', function( context ) {
window.docExample( 'example-lineTo', function( context ) {
context.canvas.width = 64;
context.canvas.height = 64;
var shape =
Expand Down Expand Up @@ -318,7 +318,7 @@ <h4 id="shape-quadraticCurveTo">quadraticCurveTo( <span class="args">cpx, cpy, x
</p>
<canvas id="example-quadraticCurveTo" class="exampleScene" style="width: 64px; height: 64px; margin: 0 auto;"></canvas>
<script type="text/javascript">
docExample( 'example-quadraticCurveTo', function( context ) {
window.docExample( 'example-quadraticCurveTo', function( context ) {
context.canvas.width = 64;
context.canvas.height = 64;
var shape =
Expand Down

0 comments on commit 36e768b

Please sign in to comment.