-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Feature/#5727/optional esc on close #5730
Conversation
There was a problem hiding this 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 :)
src/map/handler/Map.Keyboard.js
Outdated
@@ -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) { |
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change made 🙂
What @yohanboniface just said 😄 |
src/map/handler/Map.Keyboard.js
Outdated
map = this._map, | ||
offset; | ||
map = this._map, | ||
offset; |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
Looks good. Thanks! |
References #5727
Add option to disable Escape key default close popup functionalty.