FIX: Prettified code

This commit is contained in:
venarius 2019-03-17 17:46:50 +01:00 committed by Robin Ward
parent 4af0a2f00b
commit 3dfa22b55a
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,10 @@ export default Ember.Controller.extend(ModalFunctionality, Ember.Evented, {
actions: { actions: {
change(cat, e) { change(cat, e) {
let position = parseInt($(e.target).val()); let position = parseInt($(e.target).val());
let amount = Math.min(Math.max(position, 0), this.get("categoriesOrdered").length - 1); let amount = Math.min(
Math.max(position, 0),
this.get("categoriesOrdered").length - 1
);
this.moveDir(cat, amount - this.get("categoriesOrdered").indexOf(cat)); this.moveDir(cat, amount - this.get("categoriesOrdered").indexOf(cat));
}, },