mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-976: Do not display connection or connection group divs within guacGroupList if there is no corresponding template.
This commit is contained in:
@@ -85,6 +85,38 @@ angular.module('groupList').directive('guacGroupList', [function guacGroupList()
|
||||
// Get required types
|
||||
var GroupListItem = $injector.get('GroupListItem');
|
||||
|
||||
/**
|
||||
* Returns whether the given item represents a connection that can
|
||||
* be displayed. If there is no connection template, then no
|
||||
* connection is visible.
|
||||
*
|
||||
* @param {GroupListItem} item
|
||||
* The item to check.
|
||||
*
|
||||
* @returns {Boolean}
|
||||
* true if the given item is a connection that can be
|
||||
* displayed, false otherwise.
|
||||
*/
|
||||
$scope.isVisibleConnection = function isVisibleConnection(item) {
|
||||
return item.isConnection && !!$scope.connectionTemplate;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns whether the given item represents a connection group
|
||||
* that can be displayed. If there is no connection group template,
|
||||
* then no connection group is visible.
|
||||
*
|
||||
* @param {GroupListItem} item
|
||||
* The item to check.
|
||||
*
|
||||
* @returns {Boolean}
|
||||
* true if the given item is a connection group that can be
|
||||
* displayed, false otherwise.
|
||||
*/
|
||||
$scope.isVisibleConnectionGroup = function isVisibleConnectionGroup(item) {
|
||||
return item.isConnectionGroup && !!$scope.connectionGroupTemplate;
|
||||
};
|
||||
|
||||
// Set contents whenever the connection group is assigned or changed
|
||||
$scope.$watch("connectionGroup", function setContents(connectionGroup) {
|
||||
|
||||
|
@@ -24,14 +24,14 @@
|
||||
<script type="text/ng-template" id="nestedGroup.html">
|
||||
|
||||
<!-- Connection -->
|
||||
<div class="connection" ng-show="item.isConnection">
|
||||
<div class="connection" ng-show="isVisibleConnection(item)">
|
||||
<div class="caption">
|
||||
<ng-include src="connectionTemplate"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Connection group -->
|
||||
<div class="group" ng-show="item.isConnectionGroup">
|
||||
<div class="group" ng-show="isVisibleConnectionGroup(item)">
|
||||
<div class="caption">
|
||||
|
||||
<!-- Connection group icon -->
|
||||
|
Reference in New Issue
Block a user