mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 14:11:21 +00:00
Focus existing client window if already open.
This commit is contained in:
@@ -190,15 +190,27 @@
|
|||||||
var thumbnail = document.createElement("div");
|
var thumbnail = document.createElement("div");
|
||||||
thumbnail.className = "thumbnail";
|
thumbnail.className = "thumbnail";
|
||||||
|
|
||||||
function new_client(url) {
|
function new_client(id) {
|
||||||
|
|
||||||
|
// Get URL
|
||||||
|
var url = getClientURL(id)
|
||||||
|
|
||||||
return function() {
|
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
|
// Create link to client
|
||||||
var url = getClientURL(configs[i].id)
|
connection.onclick = new_client(configs[i].id);
|
||||||
connection.onclick = new_client(url);
|
|
||||||
|
|
||||||
protocol.appendChild(protocolIcon);
|
protocol.appendChild(protocolIcon);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user