Skip to content

Commit

Permalink
use SimpleDragHandler.createForwardingListener, phetsims/scenery-phet…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 14, 2017
1 parent 9dd5f65 commit b9d2ca3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/common/view/ItemCreatorNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ define( function( require ) {
var inherit = require( 'PHET_CORE/inherit' );
var ItemNode = require( 'EQUALITY_EXPLORER/common/view/ItemNode' );
var Node = require( 'SCENERY/nodes/Node' );
var SimpleDragHandler = require( 'SCENERY/input/SimpleDragHandler' );

/**
* @param {ItemCreator} itemCreator
Expand All @@ -37,13 +38,10 @@ define( function( require ) {

Node.call( this, options );

this.addInputListener( {
this.addInputListener( SimpleDragHandler.createForwardingListener(

// Create model and view for an Item
down: function( event ) {

// Don't try to start drags with a right mouse button or an attached pointer.
if ( !event.canStartPress() ) { return; }
// down function, creates model and view for an Item
function( event ) {

// create an Item
var item = itemCreator.createItem( {
Expand All @@ -67,6 +65,8 @@ define( function( require ) {
// Propagate drag to the ItemNode
itemNode.dragListener.startDrag( event );
}
), {
allowTouchSnag: true
} );

// Enable and disable, unlink unnecessary
Expand Down

0 comments on commit b9d2ca3

Please sign in to comment.