mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 08:53:38 +08:00
FIX: Made reorder more convenient by clamping the entered number
This commit is contained in:
parent
ad363f45f0
commit
4af0a2f00b
|
@ -85,7 +85,8 @@ export default Ember.Controller.extend(ModalFunctionality, Ember.Evented, {
|
|||
actions: {
|
||||
change(cat, e) {
|
||||
let position = parseInt($(e.target).val());
|
||||
this.moveDir(cat, position - this.get("categoriesOrdered").indexOf(cat));
|
||||
let amount = Math.min(Math.max(position, 0), this.get("categoriesOrdered").length - 1);
|
||||
this.moveDir(cat, amount - this.get("categoriesOrdered").indexOf(cat));
|
||||
},
|
||||
|
||||
moveUp(cat) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user