mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
Fix build
This commit is contained in:
parent
c038758f8c
commit
f36dcb6a62
1 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
|||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||
const BufferedProxy = window.BufferedProxy; // import BufferedProxy from 'ember-buffered-proxy/proxy';
|
||||
import binarySearch from 'discourse/lib/binary-search';
|
||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import Ember from 'ember';
|
||||
|
@ -47,12 +46,12 @@ export default Ember.Controller.extend(ModalFunctionality, Ember.Evented, {
|
|||
moveDir(cat, dir) {
|
||||
const cats = this.get('categoriesOrdered');
|
||||
const curIdx = cats.indexOf(cat);
|
||||
const curPos = cat.get('position');
|
||||
const desiredIdx = curIdx + dir;
|
||||
if (desiredIdx >= 0 && desiredIdx < cats.get('length')) {
|
||||
cat.set('position', cat.get('position') + dir);
|
||||
const curPos = cat.get('position');
|
||||
cat.set('position', curPos + dir);
|
||||
const otherCat = cats.objectAt(desiredIdx);
|
||||
otherCat.set('position', cat.get('position') - dir);
|
||||
otherCat.set('position', curPos - dir);
|
||||
this.send('commit');
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue