Skip to content

Commit

Permalink
Merge pull request #151 from feedbackfruits/feature/group
Browse files Browse the repository at this point in the history
Alias sortable direction to group
  • Loading branch information
jgwhite authored Oct 19, 2017
2 parents aca68a4 + f5f4e5c commit 119d80b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions addon/mixins/sortable-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ export default Mixin.create({
return height;
}).volatile(),

/**
@private
Allows host instance to use the `group` property for something else with
minimal overriding.
*/
_direction: computed.readOnly('group.direction'),

/**
@method didInsertElement
*/
Expand Down Expand Up @@ -402,7 +409,7 @@ export default Mixin.create({
maxScrollSpeed: 20,

_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 @@ -491,7 +498,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 @@ -555,7 +562,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 All @@ -581,7 +588,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 119d80b

Please sign in to comment.