mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
refactor: Move order by equipmentment button to top of view
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
habitrpg.controller('SortableInventoryController', ['$scope',
|
||||
function ($scope) {
|
||||
|
||||
// doing this in a function causes 10 $digest iteration error
|
||||
attributeSort = {
|
||||
con: ['-con', '-(con+int+per+str)'],
|
||||
int: ['-int', '-(con+int+per+str)'],
|
||||
per: ['-per', '-(con+int+per+str)'],
|
||||
str: ['-str', '-(con+int+per+str)'],
|
||||
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.setOrder = function(order) {
|
||||
$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