Allow specific group to be selected.

This commit is contained in:
Michael Jumper
2013-08-15 02:56:43 -07:00
parent 27eb3066f2
commit 738f3397b7
3 changed files with 47 additions and 1 deletions

View File

@@ -729,6 +729,9 @@ GuacAdmin.ConnectionEditor = function(connection, parameters) {
var group_select = new GuacAdmin.ConnectionGroupSelect(GuacAdmin.cached_root_group);
location_container.appendChild(group_select.getElement());
// Pre-select current value
group_select.select(location_value);
// Update location when chosen
group_select.onselect = function(group) {
location_value = group;
@@ -1058,6 +1061,9 @@ GuacAdmin.ConnectionGroupEditor = function(group, parameters) {
var group_select = new GuacAdmin.ConnectionGroupSelect(GuacAdmin.cached_root_group);
location_container.appendChild(group_select.getElement());
// Pre-select current value
group_select.select(location_value);
// Update location when chosen
group_select.onselect = function(selected_group) {
@@ -1255,6 +1261,15 @@ GuacAdmin.ConnectionGroupSelect = function(group) {
return container;
};
/**
* Pre-selects the given group.
*
* @param {GuacamoleService.ConnectionGroup} group The group to select.
*/
this.select = function(group) {
view.expand(group);
};
};
GuacAdmin.reset = function() {