Minor logic tweak

This commit is contained in:
Sam Potts
2018-01-14 22:54:03 +11:00
parent d9ec1d1b8e
commit 5f96ec6ac2
6 changed files with 9 additions and 19 deletions

View File

@ -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);
}