Skip to content

Commit

Permalink
* client/ShiftSpace.js: using hash to open console and tabs working a…
Browse files Browse the repository at this point in the history
…gain.
  • Loading branch information
swannodette committed Feb 11, 2010
1 parent 88269e6 commit f5a8553
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions client/ShiftSpace.js
Expand Up @@ -225,20 +225,20 @@ var ShiftSpace = new (function() {
SSShowShift(SSSpaceForShift(currentShift.id), currentShift.id);
}
}

/*
Function: SSCheckHash
Check the window location hash for operations that make life easiers as a developer
and a designer.
*/
function SSCheckHash()
{
var hash = $A(window.location.hash).tail(1).str();
var kvs = hash.split("&").map(function(str) {
var parts = str.split("=");
return [parts[0], JSON.decode(parts[1])];
});
var ops = kvs.hash();
var hash = $A(window.location.hash).tail(1).str(),
kvs = hash.split("&").map(function(str) {
var parts = str.split("=");
return [parts[0], JSON.decode(parts[1])];
}),
ops = kvs.hash();

if(ops["open"])
{
Expand All @@ -259,7 +259,16 @@ var ShiftSpace = new (function() {

if(ops["tab"])
{
ShiftSpaceNameTable.MainTabView.selectTabByName(ops["tab"]);
if(!ShiftSpace.Console.isLoaded())
{
ShiftSpace.Console.addEvent("load", function() {
ShiftSpaceNameTable.MainTabView.selectTabByName(ops["tab"]);
});
}
else
{
ShiftSpaceNameTable.MainTabView.selectTabByName(ops["tab"]);
}
}
}

Expand Down

0 comments on commit f5a8553

Please sign in to comment.