aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2018-01-14 22:54:03 +1100
committerSam Potts <me@sampotts.me>2018-01-14 22:54:03 +1100
commit5f96ec6ac2765c176645651881fa2d0ba666f58b (patch)
tree01377a439260287c6865532c9082acdc908faaba /src
parentd9ec1d1b8e251cf30509e88a76132c0e04f8c00d (diff)
downloadplyr-5f96ec6ac2765c176645651881fa2d0ba666f58b.tar.lz
plyr-5f96ec6ac2765c176645651881fa2d0ba666f58b.tar.xz
plyr-5f96ec6ac2765c176645651881fa2d0ba666f58b.zip
Minor logic tweak
Diffstat (limited to 'src')
-rw-r--r--src/js/ui.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/js/ui.js b/src/js/ui.js
index 08ed43ab..1ad0c43a 100644
--- a/src/js/ui.js
+++ b/src/js/ui.js
@@ -345,13 +345,16 @@ const ui = {
return;
}
+ // If there's a spot to display duration
+ const hasDuration = utils.is.element(this.elements.display.duration);
+
// If there's only one time display, display duration there
- if (!utils.is.element(this.elements.display.duration) && this.config.displayDuration && this.paused) {
+ if (!hasDuration && this.config.displayDuration && this.paused) {
ui.updateTimeDisplay.call(this, this.elements.display.currentTime, this.duration);
}
// If there's a duration element, update content
- if (utils.is.element(this.elements.display.duration)) {
+ if (hasDuration) {
ui.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);
}