Skip to content

Commit

Permalink
Add a hashchange handler for when the back button is clicked, or the …
Browse files Browse the repository at this point in the history
…hash is manually edited.
  • Loading branch information
emackey committed Dec 10, 2011
1 parent 8ba7d49 commit 26fd5d1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/assets/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function initialize_compressor(){
}

function initialize_helper() {
window.onhashchange = function() { load_url_code(); }

if ( !localStorage.getItem('glslsandbox_user') )
localStorage.setItem('glslsandbox_user', generate_user_id());
}
Expand Down Expand Up @@ -47,10 +49,6 @@ function add_server_buttons() {
parentButton = document.createElement( 'a' );
parentButton.textContent = 'parent';
parentButton.href = original_version;
parentButton.addEventListener( 'click', function() {
location.href = original_version;
load_url_code();
}, false );
toolbar.appendChild( parentButton );

set_parent_button('visible');
Expand Down

0 comments on commit 26fd5d1

Please sign in to comment.