diff --git a/guacamole/src/main/webapp/app/list/directives/guacSortOrder.js b/guacamole/src/main/webapp/app/list/directives/guacSortOrder.js index 5bc131e2f..ea5a5c9fa 100644 --- a/guacamole/src/main/webapp/app/list/directives/guacSortOrder.js +++ b/guacamole/src/main/webapp/app/list/directives/guacSortOrder.js @@ -22,7 +22,7 @@ /** * Updates the priority of the sorting property given by "guac-sort-property" - * within the StableSort object given by "guac-sort-order". The CSS classes + * within the SortOrder object given by "guac-sort-order". The CSS classes * "sort-primary" and "sort-descending" will be applied to the associated * element depending on the priority and sort direction of the given property. * @@ -39,7 +39,7 @@ angular.module('list').directive('guacSortOrder', [function guacFocus() { /** * The object defining the sorting order. * - * @type StableSort + * @type SortOrder */ var sortOrder = $scope.$eval($attrs.guacSortOrder); diff --git a/guacamole/src/main/webapp/app/list/types/StableSort.js b/guacamole/src/main/webapp/app/list/types/SortOrder.js similarity index 84% rename from guacamole/src/main/webapp/app/list/types/StableSort.js rename to guacamole/src/main/webapp/app/list/types/SortOrder.js index 0dcdc84a8..86580b8ca 100644 --- a/guacamole/src/main/webapp/app/list/types/StableSort.js +++ b/guacamole/src/main/webapp/app/list/types/SortOrder.js @@ -21,10 +21,10 @@ */ /** - * A service for defining the StableSort class. + * A service for defining the SortOrder class. */ -angular.module('list').factory('StableSort', [ - function defineStableSort() { +angular.module('list').factory('SortOrder', [ + function defineSortOrder() { /** * Maintains a sorting predicate as required by the Angular orderBy filter. @@ -35,14 +35,14 @@ angular.module('list').factory('StableSort', [ * @param {String[]} predicate * The properties to sort by, in order of precidence. */ - var StableSort = function StableSort(predicate) { + var SortOrder = function SortOrder(predicate) { /** * Reference to this instance. * - * @type StableSort + * @type SortOrder */ - var stableSort = this; + var sortOrder = this; /** * The current sorting predicate. @@ -91,20 +91,20 @@ angular.module('list').factory('StableSort', [ var descendingName = '-' + name; // Remove requested property from current predicate - stableSort.predicate = stableSort.predicate.filter(function notRequestedProperty(current) { + sortOrder.predicate = sortOrder.predicate.filter(function notRequestedProperty(current) { return current !== ascendingName && current !== descendingName; }); // Add property to beginning of predicate if (descending) - stableSort.predicate.unshift(descendingName); + sortOrder.predicate.unshift(descendingName); else - stableSort.predicate.unshift(ascendingName); + sortOrder.predicate.unshift(ascendingName); // Update sorted state - stableSort.primary = name; - stableSort.descending = !!descending; + sortOrder.primary = name; + sortOrder.descending = !!descending; }; @@ -120,7 +120,7 @@ angular.module('list').factory('StableSort', [ * property, false otherwise. */ this.isSortedBy = function isSortedBy(property) { - return stableSort.primary === property; + return sortOrder.primary === property; }; /** @@ -133,17 +133,17 @@ angular.module('list').factory('StableSort', [ this.togglePrimary = function togglePrimary(property) { // Sort in ascending order by new property, if different - if (!stableSort.isSortedBy(property)) - stableSort.reorder(property, false); + if (!sortOrder.isSortedBy(property)) + sortOrder.reorder(property, false); // Otherwise, toggle sort order else - stableSort.reorder(property, !stableSort.descending); + sortOrder.reorder(property, !sortOrder.descending); }; }; - return StableSort; + return SortOrder; }]); \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js b/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js index 479f0223c..ccd264072 100644 --- a/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js +++ b/guacamole/src/main/webapp/app/manage/controllers/manageSessionsController.js @@ -29,7 +29,7 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj // Required types var ActiveConnectionWrapper = $injector.get('ActiveConnectionWrapper'); var ConnectionGroup = $injector.get('ConnectionGroup'); - var StableSort = $injector.get('StableSort'); + var SortOrder = $injector.get('SortOrder'); // Required services var activeConnectionService = $injector.get('activeConnectionService'); @@ -55,12 +55,12 @@ angular.module('manage').controller('manageSessionsController', ['$scope', '$inj $scope.wrappers = null; /** - * StableSort instance which maintains the sort order of the visible + * SortOrder instance which maintains the sort order of the visible * connection wrappers. * - * @type StableSort + * @type SortOrder */ - $scope.wrapperOrder = new StableSort([ + $scope.wrapperOrder = new SortOrder([ 'activeConnection.username', 'activeConnection.startDate', 'activeConnection.remoteHost',