Skip to content

Commit

Permalink
fix(player): Added missing action to remove class from Captions butto…
Browse files Browse the repository at this point in the history
…n when hiding captions
  • Loading branch information
rafa8626 committed Jul 19, 2019
1 parent f936da6 commit 56dbe99
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions dist/openplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4819,10 +4819,6 @@ var Captions = function () {
if (_this.detachMenu) {
if (general_1.hasClass(_this.button, 'op-controls__captions--on')) {
_this._hide();

_this.button.classList.remove('op-controls__captions--on');

_this.button.setAttribute('data-active-captions', 'off');
} else {
_this._show();

Expand All @@ -4843,6 +4839,8 @@ var Captions = function () {
} else {
_this._show();

_this.button.classList.add('op-controls__captions--on');

_this.button.setAttribute('data-active-captions', language);
}

Expand Down Expand Up @@ -4998,6 +4996,7 @@ var Captions = function () {
value: function _hide() {
this.captions.classList.remove('op-captions--on');
this.button.setAttribute('data-active-captions', 'off');
this.button.classList.remove('op-controls__captions--on');
}
}, {
key: "_search",
Expand Down
2 changes: 1 addition & 1 deletion dist/openplayer.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/js/controls/captions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,7 @@ class Captions implements PlayerComponent {
this.current = Array.from(this.trackList).filter(item => item.language === language).pop();
if (this.detachMenu) {
if (hasClass(this.button, 'op-controls__captions--on')) {
this._hide();
this.button.classList.remove('op-controls__captions--on');
this.button.setAttribute('data-active-captions', 'off');
this._hide();
} else {
this._show();
this.button.classList.add('op-controls__captions--on');
Expand All @@ -379,6 +377,7 @@ class Captions implements PlayerComponent {
this.menu.setAttribute('aria-hidden', 'false');
} else {
this._show();
this.button.classList.add('op-controls__captions--on');
this.button.setAttribute('data-active-captions', language);
}
const event = addEvent('captionschanged');
Expand Down Expand Up @@ -559,6 +558,7 @@ class Captions implements PlayerComponent {
private _hide(): void {
this.captions.classList.remove('op-captions--on');
this.button.setAttribute('data-active-captions', 'off');
this.button.classList.remove('op-controls__captions--on');
}

/**
Expand Down

0 comments on commit 56dbe99

Please sign in to comment.