Last active
August 26, 2015 22:25
-
-
Save matheusportela/5c16032bb4f8c54cde3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printControls(){ | |
var controls = $('<div></div>') | |
.attr('id', 'controls') | |
.append( | |
$('<button></button>').text( 'rodar uma geração' ).attr( 'id', 'ciclo' ) | |
) | |
.click( function(){ | |
cycle(); | |
}); | |
$( cfg.screen ).append(controls); | |
var run = $('<div></div>') | |
.attr('id', 'controls') | |
.append( | |
$('<button></button>').text( 'rodar' ).attr('class', 'run_button').attr('id', 'ciclo') | |
) | |
.click( function() { | |
$('button.run_button').toggleClass('started'); | |
if ($('button.run_button').text() == 'rodar') | |
$('button.run_button').text('parar'); | |
else | |
$('button.run_button').text('rodar'); | |
}); | |
$( cfg.screen ).append(run); | |
window.setInterval(function(){ | |
if ($('button.run_button').hasClass('started')) | |
cycle(); | |
}, 1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment