Revert "Revert inventory equipment/gear sorting due to inability to de/equip and maybe performance issues."

This reverts commit 9d50201180.
This commit is contained in:
Blade Barringer
2016-03-17 08:09:18 -05:00
parent 9d50201180
commit c7310b97ec
8 changed files with 120 additions and 31 deletions

View File

@@ -0,0 +1,21 @@
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)'],
name: 'text()',
set: 'set'
}
$scope.order = attributeSort.name;
$scope.orderChoice = 'name';
$scope.setOrder = function (order) {
$scope.orderChoice = order;
if (order in attributeSort) {
$scope.order = attributeSort[order];
}
};
}]);