Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ngDraggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ angular.module("ngDraggable", [])
var _dragHandle;

// to identify the element in order to prevent getting superflous events when a single element has both drag and drop directives on it.
var _myid = scope.$id;
var _myid = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't var _myid = attrs.id || scope.$id; suffice instead?

if(attrs.id) {
_myid = attrs.id;
} else {
_myid = scope.$id;
}
var _data = null;

var _dragOffset = null;
Expand Down Expand Up @@ -271,7 +276,12 @@ angular.module("ngDraggable", [])

var _lastDropTouch=null;

var _myid = scope.$id;
var _myid = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

if(attrs.id) {
_myid = attrs.id;
} else {
_myid = scope.$id;
}

var _dropEnabled=false;

Expand Down