addon/components/dragon-drop.js
/**
   Sets all dragula events onto `drake` object.
   @method _setEvents
   @private
   */
Sets all dragula events onto `drake` object.
Sets all dragula events onto ` drake ` object .
_setEvents() {
    let drake = this.get('drake'),
        self = this;
    drake.on('drag', (elt) => {
      this.set('_currentItem', this.eltToData(elt));
    });
    drake.on('drop', (elt) => {
      let model = this.get('model'),
          eltData = this.get('_currentItem'),
          newIndex = this.eltIndex(elt);
      model.removeObject(eltData);
      model.insertAt(newIndex, eltData);
      if (this.get('reset')) {
        elt.parentNode.removeChild(elt);
        this._resetView();
      }
    });
    dragulaEvents.forEach(eventName => {
      if (!this[eventName]) { return; }
      drake.on(eventName, function() {
        let model = self.get('model'),
            eltData = self.get('_currentItem');
        self.sendAction(eventName, eltData, model, ...arguments);
      });
    });
  }
_setEvents ( ) { let drake = this . get ( 'drake' ) , self = this ; drake . on ( 'drag' , ( elt ) => { this . set ( '_currentItem' , this . eltToData ( elt ) ) ; } ) ; drake . on ( 'drop' , ( elt ) => { let model = this . get ( 'model' ) , eltData = this . get ( '_currentItem' ) , newIndex = this . eltIndex ( elt ) ; model . removeObject ( eltData ) ; model . insertAt ( newIndex , eltData ) ; if ( this . get ( 'reset' ) ) { elt . parentNode . removeChild ( elt ) ; this . _resetView ( ) ; } } ) ; dragulaEvents . forEach ( eventName => { if ( ! this [ eventName ] ) { return ; } drake . on ( eventName , function ( ) { let model = self . get ( 'model' ) , eltData = self . get ( '_currentItem' ) ; self . sendAction ( eventName , eltData , model , ... arguments ) ; } ) ; } ) ; }
Sets all dragula events onto `drake` object.
Sets all dragula events onto ` drake ` object .