Skip to content

Commit

Permalink
Merge pull request leforthomas#7 from Aviture/feature/fire-edited-onl…
Browse files Browse the repository at this point in the history
…y-on-end

Only fire edited event on drag end
  • Loading branch information
Jed Fong committed Feb 3, 2016
2 parents 6e7cc82 + 9c07a5e commit 58570c6
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions DrawHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1292,25 +1292,14 @@ var DrawHelper = (function() {
_self.positions[index] = position;
updateHalfMarkers(index, _self.positions);
_self._createPrimitive = true;

onEdited();
},
onDrag: function(index, position) {
_self.positions[index] = position;
updateHalfMarkers(index, _self.positions);
_self._createPrimitive = true;

onEdited();
},
onDragEnd: function(index, position) {
if (position) {
_self.positions[index] = position;
updateHalfMarkers(index, _self.positions);
_self._createPrimitive = true;
}

delete _self._handlingDragOperation;

onEdited();
}
},
Expand Down Expand Up @@ -1354,8 +1343,6 @@ var DrawHelper = (function() {
_self._markers.insertBillboard(this.index, position, _getMarkerChangeHandlers(_self));
_self._editMarkers.getBillboard(this.index - 1).position = _calculateHalfMarkerPosition(_self.positions, this.index - 1);
_self._editMarkers.insertBillboard(this.index, _calculateHalfMarkerPosition(_self.positions, this.index), _getEditMarkerChangeHandlers(_self));

onEdited();
},
onDrag: function(index, position) {
_self.positions[this.index] = position;
Expand All @@ -1364,18 +1351,9 @@ var DrawHelper = (function() {
_self._markers.getBillboard(this.index).position = position;
_self._editMarkers.getBillboard(this.index - 1).position = _calculateHalfMarkerPosition(_self.positions, this.index - 1);
_self._editMarkers.getBillboard(this.index).position = _calculateHalfMarkerPosition(_self.positions, this.index);

onEdited();
},
onDragEnd: function(index, position) {
// create new sets of makers for editing
//_self._markers.insertBillboard(this.index, position, handleMarkerChanges);
//_self._editMarkers.getBillboard(this.index - 1).position = _calculateHalfMarkerPosition(_self.positions, this.index - 1);
//_self._editMarkers.insertBillboard(this.index, _calculateHalfMarkerPosition(_self.positions, this.index), handleEditMarkerChanges);
_self._createPrimitive = true;

delete _self._handlingDragOperation;

onEdited();
}
},
Expand Down Expand Up @@ -1479,9 +1457,6 @@ var DrawHelper = (function() {
}

_self._createPrimitive = true;

onEdited();

_self._initialPrimitiveDragPosition = position;
},
onDragEnd: function onDragEnd(position) {
Expand Down Expand Up @@ -1888,8 +1863,6 @@ var DrawHelper = (function() {

_self._createPrimitive = true;

onEdited();

_self._initialPrimitiveDragPosition = position;
},
onDragEnd: function onDragEnd(position) {
Expand Down Expand Up @@ -2068,8 +2041,6 @@ var DrawHelper = (function() {

_self._createPrimitive = true;

onEdited();

_self._initialPrimitiveDragPosition = position;
},
onDragEnd: function onDragEnd(position) {
Expand Down

0 comments on commit 58570c6

Please sign in to comment.