Fix build

This commit is contained in:
Kane York 2015-09-10 14:21:36 -07:00
parent c038758f8c
commit f36dcb6a62
1 changed files with 3 additions and 4 deletions

View File

@ -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');
}
},