mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
25 lines
893 B
JavaScript
25 lines
893 B
JavaScript
habitrpg.controller('SortableInventoryController', ['$scope',
|
|
function ($scope) {
|
|
var attributeSort = {
|
|
constitution: ['-(_effectiveCon)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
intelligence: ['-(_effectiveInt)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
perception: ['-(_effectivePer)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
strength: ['-(_effectiveStr)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
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);
|
|
}]);
|