Skip to content

Commit

Permalink
Alias sortable direction to group
Browse files Browse the repository at this point in the history
  • Loading branch information
rmachielse committed Aug 16, 2017
1 parent 21d2c51 commit 6e1d257
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions addon/mixins/sortable-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ export default Mixin.create({
return height;
}).volatile(),

_direction: computed.readOnly('group.direction'),

/* Events */

/**
Expand Down Expand Up @@ -438,7 +440,7 @@ export default Mixin.create({
* @private
*/
_scrollOnEdges(drag) {
let groupDirection = this.get('group.direction');
let groupDirection = this.get('_direction');
let $element = this.$();
let scrollContainer = new ScrollContainer(scrollParent($element)[0]);
let itemContainer = {
Expand Down Expand Up @@ -528,7 +530,7 @@ export default Mixin.create({
* @private
*/
_makeDragHandler(startEvent) {
const groupDirection = this.get('group.direction');
const groupDirection = this.get('_direction');
let dragOrigin;
let elementOrigin;
let scrollOrigin;
Expand Down Expand Up @@ -600,7 +602,7 @@ export default Mixin.create({
_applyPosition() {
if (!this.element || !this.$()) { return; }

const groupDirection = this.get('group.direction');
const groupDirection = this.get('_direction');

if (groupDirection === 'x') {
let x = this.get('x');
Expand Down Expand Up @@ -629,7 +631,7 @@ export default Mixin.create({
*/
_drag(dimension) {
let updateInterval = this.get('updateInterval');
const groupDirection = this.get('group.direction');
const groupDirection = this.get('_direction');

if (groupDirection === 'x') {
this.set('x', dimension);
Expand Down

0 comments on commit 6e1d257

Please sign in to comment.