Skip to content

Alasdair/fedx 36 dropdown menu added arrow support - #31

Merged
AlasdairSwan merged 1 commit into
masterfrom
alasdair/FEDX-36-dropdown-menu-added-arrow-support
Mar 16, 2016
Merged

Alasdair/fedx 36 dropdown menu added arrow support#31
AlasdairSwan merged 1 commit into
masterfrom
alasdair/FEDX-36-dropdown-menu-added-arrow-support

Conversation

@AlasdairSwan

Copy link
Copy Markdown
Contributor

@andy-armstrong please review. This PR adds the left and right arrow support to scroll through the dropdown list (as requested 2 hackathons ago) and it adds space bar close and tab+shift capture as per Christine's PR (https://github.com/edx/edx-platform/pull/11393)

@AlasdairSwan
AlasdairSwan force-pushed the alasdair/FEDX-36-dropdown-menu-added-arrow-support branch from d1d638a to daa51d2 Compare March 11, 2016 17:52
@AlasdairSwan

Copy link
Copy Markdown
Contributor Author

@dsjen if you have a minute could you please review this PR?


handlerIsAction: function(key, $el) {
if (key === constants.keyCodes.up) {
if (key === constants.keyCodes.up || key === constants.keyCodes.left) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is just a suggestion. Have you thought about using underscore's contain? e.g. _([constants.keyCodes.up, constants.keyCodes.left]).contains(key). Maybe even creating member variables and using them:

previewKeys = [constants.keyCodes.up, constants.keyCodes.left];
...
if (_(this.previousKeys).contains(key) {...}

It may be a bit overkill for two keys though!

@dsjen

dsjen commented Mar 14, 2016

Copy link
Copy Markdown
Contributor

I left two questions that are just "nits." I think most code paths will be hit with the current tests. My last suggestion is to add a test that hits the focusLastItem()--up to you though.

LGTM! 👍

@AlasdairSwan
AlasdairSwan force-pushed the alasdair/FEDX-36-dropdown-menu-added-arrow-support branch 5 times, most recently from e6aa64a to ad62dca Compare March 15, 2016 16:30
var DropdownMenuView = Backbone.View.extend({
tpl: _.template(DropdownTpl),

// For event handling only instances do I need to scope this somehow?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These events will only be scoped to the root element of the view:

http://backbonejs.org/#View-events

I think that's what you want. If so, you can just remove this comment.

@andy-armstrong

Copy link
Copy Markdown
Contributor

Some minor nits from me, but looks great overall. 👍

@AlasdairSwan
AlasdairSwan force-pushed the alasdair/FEDX-36-dropdown-menu-added-arrow-support branch 3 times, most recently from fe8c968 to 3573e73 Compare March 16, 2016 16:41
@AlasdairSwan
AlasdairSwan force-pushed the alasdair/FEDX-36-dropdown-menu-added-arrow-support branch from b986e40 to eb2e691 Compare March 16, 2016 17:01
AlasdairSwan added a commit that referenced this pull request Mar 16, 2016
…arrow-support

Alasdair/fedx 36 dropdown menu added arrow support
@AlasdairSwan
AlasdairSwan merged commit 29033dc into master Mar 16, 2016
@AlasdairSwan
AlasdairSwan deleted the alasdair/FEDX-36-dropdown-menu-added-arrow-support branch March 16, 2016 17:05
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.

3 participants