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

Keyboard Accessible MenuItems and VolumeMenuButton #1519

Merged
merged 3 commits into from
Sep 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/css/video-js.less
Original file line number Diff line number Diff line change
Expand Up @@ -724,14 +724,24 @@ easily in the skin designer. http://designer.videojs.com/
width: 0em;
height: 0em;
margin-bottom: 3em;
}

.vjs-default-skin .vjs-menu,
.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,
.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing {
border-left: 2em solid transparent;
border-right: 2em solid transparent;

border-top: 1.55em solid rgb(0, 0, 0); /* Same width top as ul bottom */
border-top-color: rgba(7, 40, 50, 0.5); /* Same as ul background */
}

.vjs-default-skin .vjs-volume-menu-button .vjs-menu {
display: block;
width: 0px;
border: none;
}

/* Button Pop-up Menu */
.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content {
display: block;
Expand All @@ -747,8 +757,15 @@ easily in the skin designer. http://designer.videojs.com/
.background-color-with-alpha(@control-bg-color, @control-bg-alpha);
.box-shadow(-0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2));
}

.vjs-default-skin .vjs-menu-button:hover .vjs-menu {
.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content {
width: 0px;
}
.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,
.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content {
width: 10em;
}
.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,
.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing {
display: block;
}
.vjs-default-skin .vjs-menu-button ul li {
Expand Down
6 changes: 6 additions & 0 deletions src/js/control-bar/volume-menu-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ vjs.VolumeMenuButton.prototype.createMenu = function(){
contentElType: 'div'
});
var vc = new vjs.VolumeBar(this.player_, vjs.obj.merge({'vertical': true}, this.options_.volumeBar));
Copy link
Member

Choose a reason for hiding this comment

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

@gkatsev I'm realizing that the volume menu button is broken by default because vertical is true by default here and nothing else is set up to handle that. If I set it to false it makes it work. Does the BC version set this to true somewhere or would that change break things?

Copy link
Member

Choose a reason for hiding this comment

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

why would it be broken here? Seems to be working fine for us. It used to be broken when vertical wasn't quoted.

Copy link
Member

Choose a reason for hiding this comment

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

When I test this PR and try to drag the volume handle with my mouse, the bar is horizontal but the mouse movement needs to be vertical. Are you seeing something different? To be clear, I think this issue existed before this PR.

Copy link
Member

Choose a reason for hiding this comment

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

And by test I mean open /sandbox/index.html

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. There needs to be extra CSS that rotates it.

vc.on('focus', function() {
menu.lockShowing();
});
vc.on('blur', function() {
menu.unlockShowing();
});
menu.addChild(vc);
return menu;
};
Expand Down
1 change: 0 additions & 1 deletion src/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,3 @@ vjs.MenuButton.prototype.unpressButton = function(){
this.menu.unlockShowing();
this.el_.setAttribute('aria-pressed', false);
};