Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

fix #2613 with if statement, and null for pointer value rather than r… #2615

Merged
merged 2 commits into from
Jan 24, 2017

Conversation

CapitanMorgan
Copy link
Contributor

with if statement, and passing null for pointer value rather than referencing it when undefined

Copy link
Member

@Tooa Tooa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also update the documentation according to the pointer value?

@@ -160,7 +160,12 @@ class NavigationHandler {

this.body.view.scale = scale;
this.body.view.translation = { x: tx, y: ty };
this.body.emitter.emit('zoom', { direction: '+', scale: this.body.view.scale, pointer: pointer });
if (typeof(pointer) != 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this conditional expression here? There is no pointer in the scope, so this expression always evaluates to false, right?

@@ -172,7 +177,11 @@ class NavigationHandler {

this.body.view.scale = scale;
this.body.view.translation = { x: tx, y: ty };
this.body.emitter.emit('zoom', { direction: '-', scale: this.body.view.scale, pointer: pointer });
if (typeof(pointer) != 'undefined') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@Tooa Tooa added the Network label Jan 23, 2017
@CapitanMorgan
Copy link
Contributor Author

CapitanMorgan commented Jan 23, 2017

Ill remove the if, i just threw it together hastily and thought the previous person who added this pointer reference, actually had a scenario were it might not be null. Ill just pass null, found the spot in the documentation (docs/network/index.html) and added the note about it, is there any other spots that needed updating?

…note the null pointer property in certain conditions.
Copy link
Member

@Tooa Tooa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now. Thank you :)

@yotamberk yotamberk merged commit bf71d7e into almende:develop Jan 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants