mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
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:
21
website/public/js/controllers/sortableInventoryCtrl.js
Normal file
21
website/public/js/controllers/sortableInventoryCtrl.js
Normal 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];
|
||||
}
|
||||
};
|
||||
}]);
|
||||
Reference in New Issue
Block a user