mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 03:34:14 +00:00
Closes #7636 Closes #7651 This commit creates a new button on the equipment page that allows the user to group their equipment type (body location) instead of simply by class.
24 lines
685 B
JavaScript
24 lines
685 B
JavaScript
habitrpg.controller('SortableInventoryController', ['$scope',
|
|
function ($scope) {
|
|
var attributeSort = {
|
|
constitution: ['-con', '-(con+int+per+str)'],
|
|
intelligence: ['-int', '-(con+int+per+str)'],
|
|
perception: ['-per', '-(con+int+per+str)'],
|
|
strength: ['-str', '-(con+int+per+str)'],
|
|
set: 'set'
|
|
}
|
|
|
|
$scope.setOrder = function (order) {
|
|
$scope.orderChoice = order;
|
|
if (order in attributeSort) {
|
|
$scope.order = attributeSort[order];
|
|
}
|
|
};
|
|
|
|
$scope.setGrouping = function (grouping) {
|
|
$scope.groupingChoice = grouping;
|
|
};
|
|
|
|
$scope.orderChoice = 'set';
|
|
$scope.setOrder($scope.orderChoice);
|
|
}]);
|