-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work for removing Events .on()/.onStatic()/.off()/.offStatic(…
…), see #490
- Loading branch information
1 parent
928e260
commit 4a1fe16
Showing
38 changed files
with
517 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,6 @@ | |
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
|
||
import Events from '../../../../axon/js/Events.js'; | ||
import cleanArray from '../../../../phet-core/js/cleanArray.js'; | ||
import inherit from '../../../../phet-core/js/inherit.js'; | ||
import platform from '../../../../phet-core/js/platform.js'; | ||
|
@@ -54,7 +53,7 @@ function PDOMInstance( parent, display, trail ) { | |
|
||
scenery.register( 'PDOMInstance', PDOMInstance ); | ||
|
||
inherit( Events, PDOMInstance, { | ||
inherit( Object, PDOMInstance, { | ||
|
||
/** | ||
* Initializes an PDOMInstance, implements construction for pooling. | ||
|
@@ -66,8 +65,6 @@ inherit( Events, PDOMInstance, { | |
* @returns {PDOMInstance} - Returns 'this' reference, for chaining | ||
*/ | ||
initializeAccessibleInstance: function( parent, display, trail ) { | ||
Events.call( this ); // TODO: is Events worth mixing in by default? Will we need to listen to events? | ||
|
||
assert && assert( !this.id || this.isDisposed, 'If we previously existed, we need to have been disposed' ); | ||
|
||
// unique ID | ||
|
@@ -150,7 +147,7 @@ inherit( Events, PDOMInstance, { | |
} | ||
|
||
const listener = this.checkAccessibleDisplayVisibility.bind( this, i - parentTrail.length ); | ||
relativeNode.onStatic( 'accessibleDisplays', listener ); | ||
relativeNode.accessibleDisplaysEmitter.addListener( listener ); | ||
this.relativeListeners.push( listener ); | ||
} | ||
|
||
|
@@ -492,7 +489,7 @@ inherit( Events, PDOMInstance, { | |
PDOMUtils.removeElements( this.parent.peer.primarySibling, this.peer.topLevelElements ); | ||
|
||
for ( let i = 0; i < this.relativeNodes.length; i++ ) { | ||
this.relativeNodes[ i ].offStatic( 'accessibleDisplays', this.relativeListeners[ i ] ); | ||
this.relativeNodes[ i ].accessibleDisplaysEmitter.removeListener( this.relativeListeners[ i ] ); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.