Skip to content

Commit 6f292da

Browse files
authored
Merge pull request #21 from SpringRoll/bugfix/missing-properties
Bugfix/missing properties
2 parents f353207 + cf5e265 commit 6f292da

File tree

5 files changed

+42
-48
lines changed

5 files changed

+42
-48
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "springroll-container",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"main": "dist/container.min.js",
55
"dependencies":
66
{

dist/container.js

+19-22
Original file line numberDiff line numberDiff line change
@@ -1975,17 +1975,15 @@
19751975
*/
19761976
this.captionsButton = document.querySelector(this.options.captionsButton);
19771977

1978-
if (null === this.captionsButton)
1978+
if (null !== this.captionsButton)
19791979
{
1980-
return;
1981-
}
1982-
1983-
this.captionsButtonClick = function()
1984-
{
1985-
this.captionsMuted = !this.captionsMuted;
1986-
}.bind(this);
1980+
this.captionsButtonClick = function()
1981+
{
1982+
this.captionsMuted = !this.captionsMuted;
1983+
}.bind(this);
19871984

1988-
this.captionsButton.addEventListener('click', this.captionsButtonClick);
1985+
this.captionsButton.addEventListener('click', this.captionsButtonClick);
1986+
}
19891987

19901988
/**
19911989
* Set the captions are enabled or not
@@ -2104,8 +2102,11 @@
21042102
// Handle the features request
21052103
this.on('features', function(features)
21062104
{
2107-
this.captionsButton.style.display = 'none';
2108-
if (features.captions) this.captionsButton.style.display = 'inline-block';
2105+
if (null !== this.captionsButton)
2106+
{
2107+
this.captionsButton.style.display = 'none';
2108+
if (features.captions) this.captionsButton.style.display = 'inline-block';
2109+
}
21092110
});
21102111

21112112
//Set the defaults if we have none for the controls
@@ -2117,35 +2118,31 @@
21172118

21182119
plugin.opened = function()
21192120
{
2120-
if (null === this.captionsButton)
2121+
if (null !== this.captionsButton)
21212122
{
2122-
return;
2123+
this.captionsButton.classList.remove('disabled');
21232124
}
21242125

2125-
this.captionsButton.classList.remove('disabled');
21262126
this.captionsMuted = !!SavedData.read(CAPTIONS_MUTED);
21272127
this.setCaptionsStyles(SavedData.read(CAPTIONS_STYLES));
21282128
};
21292129

21302130
plugin.close = function()
21312131
{
2132-
if (null === this.captionsButton)
2132+
if (null !== this.captionsButton)
21332133
{
2134-
return;
2134+
this._disableButton(this.captionsButton);
21352135
}
2136-
2137-
this._disableButton(this.captionsButton);
21382136
};
21392137

21402138
plugin.teardown = function()
21412139
{
2142-
if (null === this.captionsButton)
2140+
if (null !== this.captionsButton)
21432141
{
2144-
return;
2142+
this.captionsButton.removeEventListener('click', this.captionsButtonClick);
2143+
delete this.captionsButton;
21452144
}
21462145

2147-
this.captionsButton.removeEventListener('click', this.captionsButtonClick);
2148-
delete this.captionsButton;
21492146
delete this._captionsStyles;
21502147
delete this.getCaptionsStyles;
21512148
delete this.setCaptionsStyles;

0 commit comments

Comments
 (0)