Skip to content

Commit

Permalink
Fixes object is not extensible error in Ember 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dgavey committed Feb 3, 2016
1 parent 4e8f4a8 commit a2c194b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions addon/mixins/droppable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Ember from 'ember';
*/

var Droppable = Ember.Mixin.create({

_currentDrag: null,
classNameBindings: [
'accepts-drag',
'self-drop'
Expand Down Expand Up @@ -155,17 +155,15 @@ var Droppable = Ember.Mixin.create({

dragLeave: function() {
this._resetDroppability();
},

// Need to track this so we can determine `self-drop`.
// It's on `Droppable` so we can test :\
dragStart(event) {
this.set('_currentDrag', event.target);
}

});

// Need to track this so we can determine `self-drop`.
// It's on `Droppable` so we can test :\
window.addEventListener('dragstart', function(event) {
Droppable.reopenClass({
_currentDrag: event.target
});
}, true);

export default Droppable;

0 comments on commit a2c194b

Please sign in to comment.