#268: Implement UserManager.remove().

This commit is contained in:
Michael Jumper
2013-02-08 00:03:22 -08:00
parent 13520cb30e
commit 46e3e97d87

View File

@@ -355,6 +355,11 @@ GuacAdmin.UserManager = function() {
*/ */
this.selected = null; this.selected = null;
/**
* Set of all user GuacAdmin.ListItems.
*/
this.items = {};
/** /**
* Returns the DOM element representing this UserManager. * Returns the DOM element representing this UserManager.
*/ */
@@ -452,6 +457,7 @@ GuacAdmin.UserManager = function() {
// Append item // Append item
element.appendChild(item_element); element.appendChild(item_element);
user_manager.items[username] = item;
}; };
@@ -459,7 +465,14 @@ GuacAdmin.UserManager = function() {
* Removes the given username from the users visible within this UserManager. * Removes the given username from the users visible within this UserManager.
*/ */
this.remove = function(username) { this.remove = function(username) {
/* STUB */
// If user exists, remove corresponding element and item entry
var item = user_manager.items[username];
if (item) {
element.removeChild(item.getElement());
delete user_manager.items[username];
}
}; };
/** /**