2016-03-17 13:09:18 +00:00
|
|
|
habitrpg.controller('SortableInventoryController', ['$scope',
|
|
|
|
|
function ($scope) {
|
|
|
|
|
var attributeSort = {
|
2016-06-23 12:55:00 +00:00
|
|
|
constitution: ['-(_effectiveCon)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
|
|
|
intelligence: ['-(_effectiveInt)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
|
|
|
perception: ['-(_effectivePer)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
|
|
|
|
strength: ['-(_effectiveStr)', '-(_effectiveCon+_effectiveInt+_effectivePer+_effectiveStr)'],
|
2016-03-17 13:09:18 +00:00
|
|
|
set: 'set'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.setOrder = function (order) {
|
|
|
|
|
$scope.orderChoice = order;
|
|
|
|
|
if (order in attributeSort) {
|
|
|
|
|
$scope.order = attributeSort[order];
|
|
|
|
|
}
|
|
|
|
|
};
|
2016-03-17 13:47:56 +00:00
|
|
|
|
2016-06-11 21:16:10 +00:00
|
|
|
$scope.setGrouping = function (grouping) {
|
|
|
|
|
$scope.groupingChoice = grouping;
|
|
|
|
|
};
|
|
|
|
|
|
2016-03-17 13:47:56 +00:00
|
|
|
$scope.orderChoice = 'set';
|
|
|
|
|
$scope.setOrder($scope.orderChoice);
|
2016-03-17 13:09:18 +00:00
|
|
|
}]);
|