Skip to content

Commit b2a1ccf

Browse files
author
Matt Karl
committed
After creating new project, changes active project
1 parent 7b6127d commit b2a1ccf

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/springroll/SpringRollStudio.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
$(".modules a").each(function(){
5353
modules.push(new ModuleButton(this, app));
5454
});
55-
56-
57-
5855
}
5956

6057
// Bind reference to the open project handler
@@ -86,6 +83,19 @@
8683
{
8784
this.closeProject();
8885
}
86+
87+
// Listen for a new project being created
88+
$(window).on('storage', function(event){
89+
if (event.key == 'project' && /new\.html/.test(event.url))
90+
{
91+
var project = event.newValue;
92+
if (project)
93+
{
94+
console.log("New project created " + project);
95+
this.openProject(project);
96+
}
97+
}
98+
});
8999
};
90100

91101
// Reference to the prototype

src/springroll/new/NewProject.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
p._onCompleted = function()
269269
{
270270
alert(this.name.val() + " created successfully");
271+
localStorage.setItem('project', this.folder.data('folder'));
271272
localStorage.setItem('width', this.appWidth.val());
272273
localStorage.setItem('height', this.appHeight.val());
273274
localStorage.setItem('namespace', this.namespace.val());

0 commit comments

Comments
 (0)