Skip to content

Commit e1d714a

Browse files
committed
Rebuilding
1 parent 30a07de commit e1d714a

File tree

2 files changed

+48
-40
lines changed

2 files changed

+48
-40
lines changed

Diff for: dist/container.js

+47-39
Original file line numberDiff line numberDiff line change
@@ -1966,13 +1966,13 @@
19661966
return;
19671967
}
19681968

1969-
this.captionsButton.addEventListener(
1970-
'click',
1971-
function()
1972-
{
1973-
this.captionsMuted = !this.captionsMuted;
1974-
}.bind(this)
1975-
);
1969+
this.captionsButtonClick = function()
1970+
{
1971+
this.captionsMuted = !this.captionsMuted;
1972+
}.bind(this);
1973+
1974+
this.captionsButton.addEventListener('click', this.captionsButtonClick);
1975+
19761976
/**
19771977
* Set the captions are enabled or not
19781978
* @property {boolean} captionsMuted
@@ -2130,7 +2130,7 @@
21302130
return;
21312131
}
21322132

2133-
this.captionsButton.off('click');
2133+
this.captionsButton.removeEventListener('click', this.captionsButtonClick);
21342134
delete this.captionsButton;
21352135
delete this._captionsStyles;
21362136
delete this.getCaptionsStyles;
@@ -2428,7 +2428,7 @@
24282428
plugin.teardown = function()
24292429
{
24302430
var pauseFocus = document.querySelector(this.options.pauseFocusSelector);
2431-
if (pauseFocusSelector !== null)
2431+
if (pauseFocus !== null)
24322432
{
24332433
pauseFocus.removeEventListener('focus');
24342434
}
@@ -2474,16 +2474,16 @@
24742474
return;
24752475
}
24762476

2477-
this.helpButton.addEventListener(
2478-
'click',
2479-
function()
2477+
// store the listener so that we can use it later
2478+
this.helpButtonClick = function()
2479+
{
2480+
if (!this.paused && !this.helpButton.classList.contains('disabled'))
24802481
{
2481-
if (!this.paused && !this.helpButton.classList.contains('disabled'))
2482-
{
2483-
this.client.send('playHelp');
2484-
}
2485-
}.bind(this)
2486-
);
2482+
this.client.send('playHelp');
2483+
}
2484+
}.bind(this);
2485+
2486+
this.helpButton.addEventListener('click', this.helpButtonClick);
24872487

24882488
this.helpButton.tooltip = function()
24892489
{
@@ -2567,7 +2567,7 @@
25672567
return;
25682568
}
25692569

2570-
this.helpButton.off('click');
2570+
this.helpButton.removeEventListener('click', this.helpButtonClick);
25712571
delete this.helpButton;
25722572
delete this._helpEnabled;
25732573
};
@@ -2589,14 +2589,14 @@
25892589
* Reference to the pause application button
25902590
* @property {HTMLElement} pauseButton
25912591
*/
2592-
this.pauseButton = document.querySelector(this.options.pauseButton);
2592+
this.pauseButton = document.querySelectorAll(this.options.pauseButton);
25932593

2594-
if (this.pauseButton === null)
2595-
{
2596-
return;
2597-
}
2594+
this.onPauseToggle = onPauseToggle.bind(this);
25982595

2599-
this.pauseButton.addEventListener('click', onPauseToggle.bind(this));
2596+
this.pauseButton.forEach(function(element)
2597+
{
2598+
element.addEventListener('click', this.onPauseToggle);
2599+
}.bind(this));
26002600

26012601
/**
26022602
* If the application is currently paused manually
@@ -2656,12 +2656,15 @@
26562656
this.trigger('pause', paused);
26572657

26582658
// Set the pause button state
2659-
if (this.pauseButton !== null)
2660-
{
2661-
this.pauseButton.classList.remove('unpaused');
2662-
this.pauseButton.classList.remove('paused');
2663-
this.pauseButton.classList.add(paused ? 'paused' : 'unpaused');
2664-
}
2659+
this.pauseButton.forEach(
2660+
function(element)
2661+
{
2662+
element.classList.remove('unpaused');
2663+
element.classList.remove('paused');
2664+
2665+
element.classList.add(paused ? 'paused' : 'unpaused');
2666+
}.bind(this)
2667+
);
26652668
}
26662669
},
26672670
get: function()
@@ -2692,26 +2695,31 @@
26922695

26932696
plugin.opened = function()
26942697
{
2695-
if (this.pauseButton === null)
2696-
{
2697-
return;
2698-
}
2699-
2700-
this.pauseButton.classList.remove('disabled');
2698+
this.pauseButton.forEach(
2699+
function(element)
2700+
{
2701+
element.classList.remove('disabled');
2702+
}.bind(this)
2703+
);
27012704

27022705
// Reset the paused state
27032706
this.paused = this._paused;
27042707
};
27052708

27062709
plugin.close = function()
27072710
{
2708-
this._disableButton(this.pauseButton);
2711+
this.pauseButton.forEach(this._disableButton.bind(this));
27092712
this.paused = false;
27102713
};
27112714

27122715
plugin.teardown = function()
27132716
{
2714-
this.pauseButton.removeEventListener('click', onPauseToggle.bind(this));
2717+
this.pauseButton.forEach(
2718+
function(element)
2719+
{
2720+
element.removeEventListener('click', this.onPauseToggle);
2721+
}.bind(this)
2722+
);
27152723
delete this.pauseButton;
27162724
delete this._isManualPause;
27172725
delete this._paused;

0 commit comments

Comments
 (0)