mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-26 09:58:48 +01:00
use jQuery instead of getElementById
This commit is contained in:
parent
cf20b6eab4
commit
55e6404fae
1 changed files with 2 additions and 2 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue