From ea2556647b626f6fa9cd04833129c31a5af1e566 Mon Sep 17 00:00:00 2001 From: Bing Lu <3262633+binglu-sh@users.noreply.github.com> Date: Thu, 26 Mar 2020 09:27:52 +0800 Subject: [PATCH] fixed multiple 'pace-running' & 'pace-done' when pace.start there is 2 'pace-done' classes in body; when pace.restart multiple times, there would be multiple 'pace-running' too. --- vendor/pace/pace.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vendor/pace/pace.js b/vendor/pace/pace.js index 09dd958..cfe31ef 100644 --- a/vendor/pace/pace.js +++ b/vendor/pace/pace.js @@ -275,7 +275,9 @@ Bar = (function() { this.el = document.createElement('div'); this.el.className = "pace pace-active"; document.body.className = document.body.className.replace(/pace-done/g, ''); - document.body.className += ' pace-running'; + if (!/pace-running/.test(document.body.className)) { + document.body.className += ' pace-running'; + } this.el.innerHTML = '