mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
21 lines
586 B
JavaScript
21 lines
586 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.orderChoice = 'set';
|
|
$scope.setOrder($scope.orderChoice);
|
|
}]);
|