mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUAC-324: Add functions for showing/hiding menu. Update menu title with connection name.
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
|
||||
<!-- Menu -->
|
||||
<div id="menu">
|
||||
<h2>Guacamole ${project.version}</h2>
|
||||
<h2 id="menu-title">Guacamole ${project.version}</h2>
|
||||
<div class="content">
|
||||
<button>Test button</button>
|
||||
<button>Test button</button>
|
||||
|
@@ -220,6 +220,8 @@ GuacUI.Client = {
|
||||
|
||||
"viewport" : document.getElementById("viewportClone"),
|
||||
"main" : document.getElementById("main"),
|
||||
"menu" : document.getElementById("menu"),
|
||||
"menu_title" : document.getElementById("menu-title"),
|
||||
"display" : document.getElementById("display"),
|
||||
"notification_area" : document.getElementById("notificationArea"),
|
||||
|
||||
@@ -782,6 +784,30 @@ GuacUI.Client.updateTitle = function () {
|
||||
else
|
||||
document.title = GuacUI.Client.connectionName;
|
||||
|
||||
GuacUI.Client.menu_title.textContent = GuacUI.Client.connectionName;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets whether the menu is currently visible.
|
||||
*
|
||||
* @param {Boolean} [shown] Whether the menu should be shown. If omitted, this
|
||||
* function will cause the menu to be shown by default.
|
||||
*/
|
||||
GuacUI.Client.showMenu = function(shown) {
|
||||
if (shown === false)
|
||||
GuacUI.Client.menu.className = "closed";
|
||||
else
|
||||
GuacUI.Client.menu.className = "open";
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns whether the menu is currently shown.
|
||||
*
|
||||
* @returns {Boolean} true if the menu is shown, false otherwise.
|
||||
*/
|
||||
GuacUI.Client.isMenuShown = function() {
|
||||
return GuacUI.Client.menu.className === "open";
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user