refactor: Move order by equipmentment button to top of view

This commit is contained in:
Blade Barringer
2016-03-14 22:20:22 -05:00
parent a6fb945120
commit 9508ed45df
4 changed files with 72 additions and 59 deletions

View File

@@ -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];
}