Fix new project creation ()

* Fix new project creation

* Fix new project creation

* const -> var
This commit is contained in:
dekrain 2016-10-12 19:56:31 +02:00 committed by Tim Mickel
parent a7522c7734
commit 49d6bd3b67
2 changed files with 10 additions and 4 deletions
playground

View file

@ -1,6 +1,12 @@
var NEW_PROJECT_HASH = 'createEmptyProject';
var loadProject = function () {
var id = location.hash.substring(1);
if (id.length < 1) {
if (id === NEW_PROJECT_HASH) {
window.vm.createEmptyProject();
return;
}
if (id.length < 1 || !isFinite(id)) {
id = '119615668';
}
var url = 'https://projects.scratch.mit.edu/internalapi/project/' +
@ -32,7 +38,7 @@ window.onload = function() {
};
document.getElementById('createEmptyProject').addEventListener('click',
function() {
document.location = '#' + 'createEmptyProject';
document.location = '#' + NEW_PROJECT_HASH;
location.reload();
});
loadProject();