Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#5727/optional esc on close #5730

Merged

Conversation

Mickyfen17
Copy link
Contributor

References #5727
Add option to disable Escape key default close popup functionalty.

Copy link
Member

@yohanboniface yohanboniface left a comment

Choose a reason for hiding this comment

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

Good!
See my comment for a very little nit-picking :)

@@ -162,7 +163,7 @@ export var Keyboard = Handler.extend({
} else if (key in this._zoomKeys) {
map.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);

} else if (key === 27 && map._popup) {
} else if (key === 27 && mapPopup && mapPopup.options.closeOnEscapeKey) {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure we need an intermediate variable to save out 2 chars on two occurrences ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄 I went back and forth deciding whether or not to use that variable. I can remove it and just go back to map._popup if that's best?

Copy link
Member

Choose a reason for hiding this comment

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

I'd say so, yes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change made 🙂

@IvanSanchez
Copy link
Member

What @yohanboniface just said 😄

map = this._map,
offset;
map = this._map,
offset;
Copy link

Choose a reason for hiding this comment

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

Minor nitpick: Could you revert the white space here? It was 2 tabs of indentation plus 4 spaces of alignment. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spaces re-added.
For some reason when I first ran jake test I got 2 Expected indentation of 2 tab characters but found 4 errors on line 144 & 145. Also linting errors in my text editor, therefore I just fixed the spacing as per the linter.
Added back the 4 additional spaces of indentation and tests still passing.

@IvanSanchez
Copy link
Member

Looks good. Thanks!

@IvanSanchez IvanSanchez merged commit 0e36b94 into Leaflet:master Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants