mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
Add checkboxes for multiselect group view.
This commit is contained in:
@@ -1003,6 +1003,19 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
// Add connection to connection list or parent group
|
// Add connection to connection list or parent group
|
||||||
var guacui_connection = new GuacUI.Connection(connection);
|
var guacui_connection = new GuacUI.Connection(connection);
|
||||||
GuacUI.addClass(guacui_connection.getElement(), "list-item");
|
GuacUI.addClass(guacui_connection.getElement(), "list-item");
|
||||||
|
|
||||||
|
// If multiselect, add checkbox for each connection
|
||||||
|
if (multiselect) {
|
||||||
|
|
||||||
|
var connection_choice = GuacUI.createElement("div", "choice");
|
||||||
|
var connection_checkbox = GuacUI.createChildElement(connection_choice, "input");
|
||||||
|
connection_checkbox.setAttribute("type", "checkbox");
|
||||||
|
|
||||||
|
connection_choice.appendChild(guacui_connection.getElement());
|
||||||
|
appendChild(connection_choice);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
appendChild(guacui_connection.getElement());
|
appendChild(guacui_connection.getElement());
|
||||||
|
|
||||||
// Set onclick event
|
// Set onclick event
|
||||||
@@ -1027,6 +1040,19 @@ GuacUI.GroupView = function(root_group, multiselect) {
|
|||||||
|
|
||||||
// Add element to display
|
// Add element to display
|
||||||
GuacUI.addClass(list_group.getElement(), "list-item");
|
GuacUI.addClass(list_group.getElement(), "list-item");
|
||||||
|
|
||||||
|
// If multiselect, add checkbox for each group
|
||||||
|
if (multiselect) {
|
||||||
|
|
||||||
|
var group_choice = GuacUI.createElement("div", "choice");
|
||||||
|
var group_checkbox = GuacUI.createChildElement(group_choice, "input");
|
||||||
|
group_checkbox.setAttribute("type", "checkbox");
|
||||||
|
|
||||||
|
group_choice.appendChild(list_group.getElement());
|
||||||
|
appendChild(group_choice);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
appendChild(list_group.getElement());
|
appendChild(list_group.getElement());
|
||||||
|
|
||||||
// Set onclick event
|
// Set onclick event
|
||||||
|
@@ -251,6 +251,17 @@ div.section {
|
|||||||
background: #CDA;
|
background: #CDA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.choice .list-item {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.choice input[type='checkbox'] {
|
||||||
|
vertical-align: top;
|
||||||
|
height: 24px;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.disabled .list-item:not(.selected) {
|
.disabled .list-item:not(.selected) {
|
||||||
opacity: 0.25;
|
opacity: 0.25;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user