Skip to content

Commit

Permalink
remove emit1(), use emit() instead, phetsims/axon#211
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 27, 2019
1 parent ab160ee commit 6b58329
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/model/Circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ define( require => {
this.circuitChangedEmitter = new Emitter();

// @public (read-only) {Emitter} - Some actions only take place after an item has been dropped
this.vertexDroppedEmitter = new Emitter();
this.vertexDroppedEmitter = new Emitter( { validationEnabled: false } );

// @public (read-only) {Emitter} - signifies that a component has been modified (for example, with the
// CircuitElementEditNode)
Expand Down
2 changes: 1 addition & 1 deletion js/model/CircuitConstructionKitModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ define( require => {
// TODO (phet-io): investigate coarse-grained messages (vertex cut, item added, etc) instead of vertex added,
// which could lead to inconsistent state. On the other hand, why is CircuitElement added before vertex? That
// could solve it
setTimeout( () => circuitChangedEmitter.emit1( JSON.stringify( this.circuit.toStateObject() ) ), 0 );
setTimeout( () => circuitChangedEmitter.emit( JSON.stringify( this.circuit.toStateObject() ) ), 0 );
};
this.circuit.vertices.lengthProperty.link( emitCircuitChanged );
this.circuit.componentEditedEmitter.addListener( emitCircuitChanged );
Expand Down
2 changes: 1 addition & 1 deletion js/model/CircuitElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ define( require => {

// @public (read-only) {Emitter} - indicate when the circuit element has started being dragged, when it is created
// in the toolbox
this.startDragEmitter = new Emitter();
this.startDragEmitter = new Emitter( { validationEnabled: false } );

// @public (read-only) {Emitter} - indicate when the circuit element has been disposed
this.disposeEmitter = new Emitter();
Expand Down
2 changes: 1 addition & 1 deletion js/model/Meter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ define( require => {
} );

// @public (read-only) {Emitter} Fires an event when the meter is dropped
this.droppedEmitter = new Emitter(); // Fire event when dropped
this.droppedEmitter = new Emitter( { validationEnabled: false } ); // Fire event when dropped
}

/**
Expand Down
2 changes: 1 addition & 1 deletion js/view/AmmeterNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ define( require => {
this.dragHandler = new MovableDragHandler( ammeter.bodyPositionProperty, {
tandem: tandem.createTandem( 'dragHandler' ),
endDrag: function() {
ammeter.droppedEmitter.emit1( bodyNode.globalBounds );
ammeter.droppedEmitter.emit( bodyNode.globalBounds );

// After dropping in the play area the probes move independently of the body
ammeter.draggingProbesWithBodyProperty.set( false );
Expand Down
2 changes: 1 addition & 1 deletion js/view/CircuitElementToolNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ define( require => {
// @jonathanolson and I looked into the way Charges and Fields just calls startDrag(event) on the play area drag
// listener (which adds a listener to the pointer, in the usual SimpleDragHandler way), and it seems like a good
// pattern.
circuitElement.startDragEmitter.emit1( event );
circuitElement.startDragEmitter.emit( event );
}, {
allowTouchSnag: true
} ) );
Expand Down
2 changes: 1 addition & 1 deletion js/view/CircuitLayerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ define( require => {
vertexNode.startOffset = null;

// Signify that something has been dropped in the play area, to show the edit panel, unless dropped in the toolbox
this.circuit.vertexDroppedEmitter.emit1( vertex );
this.circuit.vertexDroppedEmitter.emit( vertex );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion js/view/VoltmeterNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ define( require => {
this.dragHandler = new MovableDragHandler( voltmeter.bodyPositionProperty, {
tandem: tandem.createTandem( 'dragHandler' ),
endDrag: () => {
voltmeter.droppedEmitter.emit1( bodyNode.globalBounds );
voltmeter.droppedEmitter.emit( bodyNode.globalBounds );

// After dropping in the play area the probes move independently of the body
voltmeter.draggingProbesWithBodyProperty.set( false );
Expand Down

0 comments on commit 6b58329

Please sign in to comment.