-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1838 from mmcc/feature/control-bar-separator
Feature/control bar separator
- Loading branch information
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/js/control-bar/spacer-controls/custom-control-spacer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Spacer from './spacer.js'; | ||
|
||
/** | ||
* Spacer specifically meant to be used as an insertion point for new plugins, etc. | ||
* | ||
* @param {Player|Object} player | ||
* @param {Obect=} options | ||
*/ | ||
class CustomControlSpacer extends Spacer { | ||
buildCSSClass() { | ||
return `vjs-custom-control-spacer ${super.buildCSSClass}`; | ||
} | ||
|
||
createEl() { | ||
return super.createEl({ | ||
className: this.buildCSSClass() | ||
}); | ||
} | ||
} | ||
|
||
Spacer.registerComponent('CustomControlSpacer', CustomControlSpacer); | ||
|
||
export default CustomControlSpacer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Component from '../../component.js'; | ||
|
||
/** | ||
* Just an empty spacer element that can be used as an append point for plugins, etc. | ||
* Also can be used to create space between elements when necessary. | ||
* | ||
* @param {Player|Object} player | ||
* @param {Object=} options | ||
*/ | ||
class Spacer extends Component { | ||
buildCSSClass() { | ||
return `vjs-spacer ${super.buildCSSClass()}`; | ||
} | ||
|
||
createEl(props) { | ||
return super.createEl('div', { | ||
className: this.buildCSSClass() | ||
}); | ||
} | ||
} | ||
|
||
Component.registerComponent('Spacer', Spacer); | ||
|
||
export default Spacer; |