Skip to content

Commit

Permalink
move orientationClass logic into buildCSSClass
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcc committed Jul 15, 2015
1 parent f2e4299 commit c752fe3
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/js/control-bar/volume-menu-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ class VolumeMenuButton extends MenuButton {
* @method buildCSSClass
*/
buildCSSClass() {
return `vjs-volume-menu-button ${super.buildCSSClass()} ${this.orientationClassName()}`;
let orientationClass = '';
if (!!this.options_.vertical) {
orientationClass = 'vjs-volume-menu-button-vertical';
} else {
orientationClass = 'vjs-volume-menu-button-horizontal';
}

return `vjs-volume-menu-button ${super.buildCSSClass()} ${orientationClass}`;
}

/**
Expand All @@ -81,19 +88,6 @@ class VolumeMenuButton extends MenuButton {
return menu;
}

/**
* Generates a class name with the appropriate orientation for the slider
*
* @method orientationClassName
*/
orientationClassName() {
if (!!this.options_.vertical) {
return 'vjs-volume-menu-button-vertical';
}

return 'vjs-volume-menu-button-horizontal';
}

/**
* Handle click on volume menu and calls super
*
Expand Down

0 comments on commit c752fe3

Please sign in to comment.