PeerTube/client/src/assets/player/shared/settings/settings-dialog.ts

47 lines
969 B
TypeScript
Raw Normal View History

2020-04-21 11:02:28 +02:00
import videojs from 'video.js'
2020-01-28 17:29:50 +01:00
const Component = videojs.getComponent('Component')
class SettingsDialog extends Component {
2020-04-17 11:20:12 +02:00
constructor (player: videojs.Player) {
2020-01-28 17:29:50 +01:00
super(player)
this.hide()
}
/**
* Create the component's DOM element
*
*/
createEl () {
const uniqueId = this.id()
const dialogLabelId = 'TTsettingsDialogLabel-' + uniqueId
const dialogDescriptionId = 'TTsettingsDialogDescription-' + uniqueId
return super.createEl('div', {
className: 'vjs-settings-dialog vjs-modal-overlay',
tabIndex: -1
}, {
2023-05-24 15:27:15 +02:00
'role': 'dialog',
2020-01-28 17:29:50 +01:00
'aria-labelledby': dialogLabelId,
'aria-describedby': dialogDescriptionId
})
}
2023-06-29 15:55:00 +02:00
show () {
this.player().addClass('vjs-settings-dialog-opened')
super.show()
}
hide () {
this.player().removeClass('vjs-settings-dialog-opened')
super.hide()
}
2020-01-28 17:29:50 +01:00
}
Component.registerComponent('SettingsDialog', SettingsDialog)
export { SettingsDialog }