From ec1a87eb06c564afd485a35d6aa29734eb981d10 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 13 Jul 2011 20:52:59 +0200 Subject: [PATCH] use jQuery instead of getElementById --- js/star.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/star.js b/js/star.js index 17ba88f..d83a8a3 100644 --- a/js/star.js +++ b/js/star.js @@ -91,7 +91,7 @@ function won_or_not( state ) { } function display_on_canvas( state, canvas_elt ) { - var ctx= document.getElementById( canvas_elt ).getContext( '2d' ); + var ctx= $( canvas_elt )[ 0 ].getContext( '2d' ); for ( var i=0 ; i < LEVEL_HEIGHT ; i++ ) { for ( var j=0 ; j < LEVEL_WIDTH ; j++ ) { var c = get_cell( state, j, i ); @@ -130,7 +130,7 @@ function format_help( ) { function display_level( state, elt ) { $( elt + " .gstar #infos" ).html( format_infos( state ) ); - display_on_canvas( state, "starboard" ); + display_on_canvas( state, elt + " #starboard" ); } function load_level( levelset, nb ) {