diff --git a/www/assets/app.js b/www/assets/app.js index c2f54ce..e6015dc 100644 --- a/www/assets/app.js +++ b/www/assets/app.js @@ -164,9 +164,10 @@ $scope.instances.push(instance); $scope.idx[instance.name] = instance; } - if ($scope.instances.length) { - $scope.showInstance($scope.instances[0]); - } + + // If instance is passed in URL, select it + let inst = $scope.idx[$location.hash()]; + if (inst) $scope.showInstance(inst); }, function(response) { if (response.status == 404) { document.write('session not found'); @@ -183,6 +184,7 @@ $scope.showInstance = function(instance) { $scope.selectedInstance = instance; + $location.hash(instance.name); if (!instance.creatingTerminal) { if (!instance.term) { $timeout(function() { @@ -287,8 +289,8 @@ } } }]) - - .config(['$mdIconProvider', function($mdIconProvider) { - $mdIconProvider.defaultIconSet('../assets/social-icons.svg', 24); - }]); + .config(['$mdIconProvider', '$locationProvider', function($mdIconProvider, $locationProvider) { + $locationProvider.html5Mode({enabled: true, requireBase: false}); + $mdIconProvider.defaultIconSet('../assets/social-icons.svg', 24); + }]); })();