Focus existing client window if already open.

This commit is contained in:
Michael Jumper
2012-11-05 00:49:39 -08:00
parent 0dc34294e6
commit dce2de0a5a

View File

@@ -190,15 +190,27 @@
var thumbnail = document.createElement("div");
thumbnail.className = "thumbnail";
function new_client(url) {
function new_client(id) {
// Get URL
var url = getClientURL(id)
return function() {
window.open(url);
// Attempt to focus existing window
var current = window.open(null, id);
// If window did not already exist, set up as
// Guacamole client
if (!current.GuacamoleUI)
window.open(url, id);
};
}
// Create link to client
var url = getClientURL(configs[i].id)
connection.onclick = new_client(url);
connection.onclick = new_client(configs[i].id);
protocol.appendChild(protocolIcon);