aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index 39ddb79c..f091555f 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -10,7 +10,7 @@ import { repaint, transitionEndEvent } from './utils/animation';
import { dedupe } from './utils/arrays';
import browser from './utils/browser';
import { createElement, emptyElement, getAttributesFromSelector, getElement, getElements, hasClass, removeElement, setAttributes, toggleClass, toggleHidden, toggleState } from './utils/elements';
-import { once } from './utils/events';
+import { on, off } from './utils/events';
import is from './utils/is';
import loadSprite from './utils/loadSprite';
import { extend } from './utils/objects';
@@ -845,7 +845,7 @@ const controls = {
// Generate options data
const options = tracks.map((track, value) => ({
value,
- checked: this.captions.active && this.currentTrack === value,
+ checked: this.captions.toggled && this.currentTrack === value,
title: captions.getLabel.call(this, track),
badge: track.language && controls.createBadge.call(this, track.language.toUpperCase()),
list,
@@ -855,7 +855,7 @@ const controls = {
// Add the "Disabled" option to turn off captions
options.unshift({
value: -1,
- checked: !this.captions.active,
+ checked: !this.captions.toggled,
title: i18n.get('disabled', this.config),
list,
type: 'language',
@@ -1015,7 +1015,7 @@ const controls = {
return;
}
- // Are we targetting a tab? If not, bail
+ // Are we targeting a tab? If not, bail
const isTab = pane.getAttribute('role') === 'tabpanel';
if (!isTab) {
return;
@@ -1051,10 +1051,12 @@ const controls = {
container.style.width = '';
container.style.height = '';
+ // Only listen once
+ off.call(this, container, transitionEndEvent, restore);
};
// Listen for the transition finishing and restore auto height/width
- once.call(this, container, transitionEndEvent, restore);
+ on.call(this, container, transitionEndEvent, restore);
// Set dimensions to target
container.style.width = `${size.width}px`;